Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add proxy support #375

Merged
merged 2 commits into from May 29, 2020
Merged

Conversation

chiefjester
Copy link
Contributor

@chiefjester chiefjester marked this pull request as ready for review May 29, 2020 16:10
@chiefjester
Copy link
Contributor Author

@FredKSchott @germanftorres
So some improvements I made. I had SSL disabled and changeorigin to true. This would make https proxy work normally. The alternative is add our own certificate in snowpack which I don't think is a good idea since that's another thing we need to maintain.

This would now work on both POST and GET methods, as mentioned here

This will also fix @fcamblor issue as I've tested, it forwards the encoding headers correctly:

image

Some room for improvements, @FredKSchott do you think we need to pass the options for the the http-proxy in order for other people to extend it?

As it currently stands, if someone wants to extend it, they can just make a new server and just pass it in the proxy and they can do whatever they want with that http-server. So I personally don't think we need to make it more complicated as it is.

@chiefjester chiefjester force-pushed the germanftorres/master branch 3 times, most recently from 94707b2 to 225bf5e Compare May 29, 2020 17:28
- proxy: remove secure option to enable ssl
- add changeOrigin true to make proxy work
@chiefjester
Copy link
Contributor Author

@FredKSchott 👋 rebased more context here

@FredKSchott
Copy link
Owner

This makes sense! Thanks for explaining your reasoning. We'll probably want to move this into the createProxy call when we add support for user configuration, but I think this is fine for now.

@FredKSchott FredKSchott merged commit c9eefa2 into FredKSchott:master May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve proxy support with http-proxy
2 participants