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 ProxyConectionFactory for enabling the proxy protocol. #2709

Merged
merged 6 commits into from Mar 27, 2019
Merged

Add ProxyConectionFactory for enabling the proxy protocol. #2709

merged 6 commits into from Mar 27, 2019

Conversation

tyagiakhilesh
Copy link
Contributor

@tyagiakhilesh tyagiakhilesh commented Mar 26, 2019

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).

@tyagiakhilesh
Copy link
Contributor Author

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.

@jplock
Copy link
Member

jplock commented Mar 26, 2019

@tyagiakhilesh thanks for this, is there anyway to provide a test that it gets enabled when useProxyProtocol is set to true?

@jplock jplock added the feature label Mar 26, 2019
@tyagiakhilesh
Copy link
Contributor Author

tyagiakhilesh commented Mar 26, 2019

@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.

@jplock
Copy link
Member

jplock commented Mar 27, 2019

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.

@jplock jplock added this to the 2.0.0 milestone Mar 27, 2019
Copy link
Member

@jplock jplock left a 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

@tyagiakhilesh
Copy link
Contributor Author

@jplock Updated release notes.

@joschi joschi merged commit d946d98 into dropwizard:master Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants