Which headers does SFS2X read for geolocation info?
We're testing server behind Amazon ELB proxy, and in admin tool I see IP address of proxy when user connects.
ELB is adding automatically X-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Port headers (I guess SFS is reading headers before connection is Upgraded to websocket)
I've found simillar topics but didn't find what I need
SFS2X behind Amazon ELB and client IP
-
- Posts: 8
- Joined: 19 Dec 2018, 10:00
Re: SFS2X behind Amazon ELB and client IP
Hi,
the server uses the IP address of the connecting client, directly from it's socket. If a proxy is in between all connections will appear as coming from that source.
These are HTTP related headers, which are irrelevant for SmartFoxServer unless you're connecting via websockets.
At the moment we don't support these headers for websocket connections but we might look into it for a future release.
As I mentioned, keep in mind that this won't work for standard TCP sockets and UDP.
Cheers
the server uses the IP address of the connecting client, directly from it's socket. If a proxy is in between all connections will appear as coming from that source.
ELB is adding automatically X-Forwarded-For, X-Forwarded-Proto and X-Forwarded-Port headers (I guess SFS is reading headers before connection is Upgraded to websocket)
These are HTTP related headers, which are irrelevant for SmartFoxServer unless you're connecting via websockets.
At the moment we don't support these headers for websocket connections but we might look into it for a future release.
As I mentioned, keep in mind that this won't work for standard TCP sockets and UDP.
Cheers
-
- Posts: 8
- Joined: 19 Dec 2018, 10:00
Re: SFS2X behind Amazon ELB and client IP
So basically, it doesn't support proxied requests?
Re: SFS2X behind Amazon ELB and client IP
Requests work, of course. What does not work is recognizing the original sender IP because the proxy is the one establishing the physical connection to the server.
With websockets it should be possible to detect those HTTP headers and make sure the server obtains the correct client IP.
Are you using TCP sockets? Or websocket?
Thanks
With websockets it should be possible to detect those HTTP headers and make sure the server obtains the correct client IP.
Are you using TCP sockets? Or websocket?
Thanks
-
- Posts: 8
- Joined: 19 Dec 2018, 10:00
Re: SFS2X behind Amazon ELB and client IP
Lapo wrote:Requests work, of course. What does not work is recognizing the original sender IP because the proxy is the one establishing the physical connection to the server.
Yes, I didn't express my self correctly, but i thought that.
Lapo wrote:With websockets it should be possible to detect those HTTP headers and make sure the server obtains the correct client IP.
Are you using TCP sockets? Or websocket?
Thanks
We're using websocket (with binary protocol) - HTML5 + JS
Re: SFS2X behind Amazon ELB and client IP
Okay. I've added a note to look into this for the next SFS2X update.
Happy holidays.
Happy holidays.
-
- Posts: 8
- Joined: 19 Dec 2018, 10:00
Re: SFS2X behind Amazon ELB and client IP
thanks!
Happy holidays to you too
Happy holidays to you too
Who is online
Users browsing this forum: No registered users and 100 guests