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

Is it possible to get client address when using tcp+sni? #504

Open
doctorj opened this issue Jun 4, 2018 · 10 comments
Open

Is it possible to get client address when using tcp+sni? #504

doctorj opened this issue Jun 4, 2018 · 10 comments

Comments

@doctorj
Copy link

doctorj commented Jun 4, 2018

On backend server when I inspect RemoteAddr I get address of server that fabio is running on.
Can fabio log those requests so I can get them there?

Thanks.

@deuch
Copy link

deuch commented Jun 13, 2018

Did you check the X-Forwared-For header in your backend ? Proxies set this value to pass the IP of the client of the initial request.

@doctorj
Copy link
Author

doctorj commented Jun 14, 2018

Hi deuch,

Yes, I did check "X-Forwarded-For" header. It is empty. "Forwarded", "X-Real-Ip", "X-Forwarded-Port", "X-Forwarded-Proto", "X-Forwarded-Host" also.
Fabio is not setting headers when runing TCP-SNI Proxy. I haven't tried, but headers are probably set when fabio is running TCP Proxy when TLS termination is done on fabio.

@aaronhurt
Copy link
Member

aaronhurt commented Jun 14, 2018

TCP listeners including the TCP+SNI listener are passthtough to the backend. If you want fabio to add headers you will need to use an HTTP and/or an HTTPS listener. The HTTPS listener will terminate TLS at fabio and can optionally reoriginate with TLS to the backend if you specify proto=https as a route option.

@doctorj
Copy link
Author

doctorj commented Jun 14, 2018

Hi leprechau, thanks for replying

I understand that headers are not set when running TCP-SNI Proxy, but I was wondering is there some other way to find out client address.
It doesn't have to be on backend. Is it possible for fabio to log requests that are passed through?
I have set "log.access.target = stdout", but have nothing on stdout. Am I doing something wrong or fabio is not logging requests when running TCP-SNI Proxy?

@aaronhurt
Copy link
Member

aaronhurt commented Jun 14, 2018

Sorry, I see what you are asking now. The current answer is no. The TCP and TCP+SNI proxy do not currently have any access logging. I can see this being a nice feature and would offer parity with the HTTP proxy.

@aaronhurt
Copy link
Member

The HTTP access logging was originally added in #80

@magiconair
Copy link
Contributor

Outbound PROXY protocol support might help ...

@KEZHwMlXV1vFzs6QvY8v5WjX5

yes outbound PROXY protocol would be really great!

@mfuterko
Copy link
Contributor

mfuterko commented Jan 29, 2019

It would be great if somebody could test it, please? #598

@vjeantet
Copy link

Hello, any update on this ?

Does PROXY PROTOCOL works with TCP+SNI ?

ref : #177

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

No branches or pull requests

7 participants