Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
herokuでsocket.ioを使用していますが、ソケット接続でクライアントIPを取得したいのですが、現在、実際のIPではないIPを取得しています(これはherokuのIPだと思います)。
私はsocket.manager.handshaken[socket.id].address.addressを使用してユーザーのIPを取得しています。別の方法はありますか?
試す:
socket.manager.handshaken[socket.id].remoteAddress
クライアントポートが必要な場合は、次のようになります。 socket.manager.handshaken[socket.id].remotePort
socket.manager.handshaken[socket.id].remotePort