-
Notifications
You must be signed in to change notification settings - Fork 564
Official way for getting IP of socket #566
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
Comments
Hmm... it seems you are looking for io.on('connection', (socket) => {
let ip = socket.handshake.address;
// ...
}); As usual, if you find ways to improve the documentation, please do open a PR! 👍 |
I will, thanks for reply. The big problems are posts around the web about "this is a problem" and provided solutions that sometimes work, in some version of eio/sio work etc. so together with hole in documentation it makes me to post and issue here. I've already found by consolelogging socket object that socket itself has remoteAddress property that contains correct (in my situation) IP, is it safe way? Or I should use socket.handshake.address? |
|
Uh oh!
There was an error while loading. Please reload this page.
There are Socket.io v2 and Engine.io v3 and (still O_O) there is not any official way for getting IP of connection. Why? It is one of the most needed feature.
The text was updated successfully, but these errors were encountered: