简体   繁体   中英

Retrieving client IP address with Socket.io v1.0 and Express

How does one retrieve the IP address of a socket.io connecting client?

This does not work in Socket.io v1.0: Get the client's IP address in socket.io . It returns undefined .

I tried doing a console.dir of the socket object, but this does not seem to work.

这个怎么样:

socket.request.socket.remoteAddress

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM