📜  在节点 js 中获取用户的 ip - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:18.982000             🧑  作者: Mango

代码示例1
//In your request object there is a property called connection, 
//which is a net.Socket object. The net.Socket object has a property 
//remoteAddress, therefore you should be able to get the IP with this call:

request.connection.remoteAddress