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

socket.io in nodejs client IP is google-proxy-[IP].google.com #2162

Closed
ghost opened this issue Jun 27, 2015 · 2 comments
Closed

socket.io in nodejs client IP is google-proxy-[IP].google.com #2162

ghost opened this issue Jun 27, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 27, 2015

hey i just notice something wrong with using socket.io for Chat Server
when i use native websockets i get clients real IP

but with socket.io some of my clients ip is 66.249.93.193
hostname is: google-proxy-66-249-93-193.google.com

so what google proxy is doing here? if i just edit my html and remove the socket.io and use only websockets all ip are correct

but when using socket.io i see this 66.249.93.193 ip for more than 20% of my clients

is socket.io using any remote server for sending packets ? that can be privacy problem and problem when i ban client by ip will ban many clients

my method to get client ip is this in nodejs
function getIP(req)
{
var ip =req.connection.remoteAddress ||
req.socket.remoteAddress ||
req.connection.socket.remoteAddress;
return ip.split(":").last(); ' // return last index in array
}

btw the ip i write here is not the only one there is many ips for the same google proxy hostname

any one here know what is this?

@ghost
Copy link
Author

ghost commented Jul 7, 2015

fixed

its that google Chrome mobile version

used: data compression proxy

https://developer.chrome.com/multidevice/data-compression

*** As a site owner, how do I perform IP geo-targeting?
The IP address of your device is forwarded to the destination server via the X-Forwarded-For header. Site owners should check for this header to correctly determine the location of the user based on client's IP address.

@darrachequesne
Copy link
Member

That issue was closed automatically. Please check if your issue is fixed with the latest release, and reopen if needed (with a fiddle reproducing the issue if possible).

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

2 participants
@darrachequesne and others