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 ProxyConectionFactory for enabling the proxy protocol. #2709
Conversation
Tests are failing of course, as by default the proxy protocol must be disabled. Once I figure out a way to make it configurable, things shall start looking better. |
@tyagiakhilesh thanks for this, is there anyway to provide a test that it gets enabled when |
@jplock Done. Added the test case. Note: it is deliberate that I am finding the specific object at index 0 (in the last commit - in test case). Otherwise feature does not work. |
Thanks @tyagiakhilesh, sorry I should have mentioned this before as well, but would you mind adding an entry under the 2.0.0 release notes in https://github.com/dropwizard/dropwizard/blob/master/docs/source/about/release-notes.rst for this PR? Then this should be good to merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once the release notes are updated
@jplock Updated release notes. |
Problem:
A DW service running behind a proxy/LB need to know the real source of the request. Attempt to solve #1176
Solution:
Proxy-Protocol is one the solution for this. Jetty has inbuilt support for it. We just need to utilize that.
Result:
request.getRemoteAddr() and request.getRemoteHost() shall give you information about the client that is making the request to proxy not of proxy itself (which is the case as of today without this feature).