-
Notifications
You must be signed in to change notification settings - Fork 363
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
(WIP) PROXY protocol support #110
base: master
Are you sure you want to change the base?
Conversation
Remove the useless spaces is good for me. Thank you. I'm reviewing this pull request. |
c->log->action = "ngx_tcp_proxy_send_proxy_protocol"; | ||
|
||
client = (struct sockaddr_in*)s->connection->sockaddr; | ||
listener = (struct sockaddr_in*)s->connection->listening->sockaddr; // doesn't appear to be correct |
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.
Try the s->connection->local_sockaddr
, it should store the destination address.
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.
I gave it a go, doesn't seem to return the correct values either. IP is 0.0.0.0 and the port is not the port defined in the configuration. Not that important anyway IMO
Hi, any news about this PR ? |
This PR is a hack that implements PROXY protocol (http://www.haproxy.org/download/1.5/doc/proxy-protocol.txt) which allows upstream TCP servers to be notified the original IP and port of the client.
Tested with nginx 1.7.9.
Sorry about whitespace changes and probable code quality as I'm not familiar with C and this is my first bit of work on an nginx module.
The function in question: https://github.com/yaoweibin/nginx_tcp_proxy_module/pull/110/files#diff-439a7558cb55631857d62112acec7449R237
Example configuration:
Issues: