Conversation
|
Because I needed this sooner rather than later, I released my fork as |
| // If a proxy exists, forward the request to the appropriate server | ||
| if (proxy && proxy.destination) { | ||
| const { destination } = proxy | ||
| const newDestination = `${destination}${request.url}` |
There was a problem hiding this comment.
It is not well described in the read me how the final destination URL will be compiled.
Also logging the final destination URL before sending the request might help somebody.
There was a problem hiding this comment.
I'm OK with this, but wonder if the logging should be hidden behind a flag?
There was a problem hiding this comment.
That's entirely fair. Right now the behavior is that your example would work by going to http://httpbin.org/get/api. Is that not the desired behavior? Either way I will add some language to the README to clarify.
There was a problem hiding this comment.
You are right, the final url is http://httpbin.org/get/api, but shouldn't this result in 404 status code proxied instead of "Content Encoding Error".
I did not check the actual response cloning code to check what is actually happening.
Maybe I did not test properly.
I also used it to proxy to a complicated apache setup which has reverse proxy and somehow I could not get it working.
Maybe not all request headers from the original request are copied?
There was a problem hiding this comment.
I set up the proxy,but always return 404
pstanoev
left a comment
There was a problem hiding this comment.
Using it with:
proxy: {
"api": "http://httpbin.org/get",
}
Results with "Content Encoding Error"
|
Sorry I've been AWOL on this. I got busy on a couple different projects, but I fully intend to pick this back up as soon as possible. |
|
any update on this feature ? |
|
I'm using rollup-plugin-serve-proxy - thanks very much for the fork - but it would be great to get this merged! |
|
Did I resolve the merge conflicts correctly? |
|
Thanks for all the work into the plugin and this PR. What's the status on this? Would be really helpful for us |
Adds basic proxy support similar to the most basic webpack-dev-server usage. This is pretty bare-bones right now, but can be amended to support the extended syntax. Should resolve #17.