fabio icon indicating copy to clipboard operation
fabio copied to clipboard

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

Open doctorj opened this issue 7 years ago • 10 comments
trafficstars

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.

doctorj avatar Jun 04 '18 13:06 doctorj

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.

deuch avatar Jun 13 '18 21:06 deuch

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.

doctorj avatar Jun 14 '18 06:06 doctorj

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.

aaronhurt avatar Jun 14 '18 11:06 aaronhurt

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?

doctorj avatar Jun 14 '18 13:06 doctorj

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 avatar Jun 14 '18 14:06 aaronhurt

The HTTP access logging was originally added in #80

aaronhurt avatar Jun 14 '18 14:06 aaronhurt

Outbound PROXY protocol support might help ...

magiconair avatar Sep 19 '18 19:09 magiconair

yes outbound PROXY protocol would be really great!

It would be great if somebody could test it, please? https://github.com/fabiolb/fabio/pull/598

mfuterko avatar Jan 29 '19 14:01 mfuterko

Hello, any update on this ?

Does PROXY PROTOCOL works with TCP+SNI ?

ref : https://github.com/fabiolb/fabio/issues/177

vjeantet avatar Jul 29 '20 12:07 vjeantet