-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 reverse proxy capability #143
base: master
Are you sure you want to change the base?
Conversation
Hi, What would be the advantage to the users for using goproxy as a reverse proxy? There are many other solutions which are probably superior. I'd like to understand the use case before taking a big change. Thanks! |
It allows people who need both a forward and a reverse proxy to use a single library. They can then use the same interfaces for both cases (i.e. enjoying In our use case, we can have a single server (listening on only one port) doing either request authorization/signing (ie. HMAC or JWT) or request verification depending on how it's called (as a proxy or as a reverse proxy). |
Sounds reasonable. BTW, I think a better approach is, not to add What do you think? |
Hi, Thanks for the response. I noticed that we shouldn't have both the proxy and the reverse proxy on the same port, even though the idea looked nice. Some people might want to terminate TLS on the reverse proxy, however it is impossible to get a forward proxy working properly with TLS termination. Thus, I modified and simplified slightly my PR. It now simply exposes a new constructor |
Bump |
Hey, I was looking for same functionality and bumped into this PR, is it going to be merged? |
Hi, Note that in the meantime, you can use https://github.com/coreos/goproxy, which supports reverse proxies and websockets. |
cool, thanks @Quentin-M! |
Because why should we limit ourselves to a forward proxy server when we could do both reverse and forward proxying at the same time?
This commit allows us to specify a
ProxyHttpServer
inNewProxyHttpServer
that will act as a reverse proxy when the forward proxy constructed will be called as a reverse proxy. When no reverse proxy is specified and the forward proxy is called as a reverse proxy, a response with status code 500 and messageThis is a proxy server. Does not respond to non-proxy requests.
, just like before.