如何确定控制器中给定请求的IP地址?例如(快递):
app.post('/get/ip/address', function (req, res) {
// need access to IP address here
})
如何确定节点中的用户IP地址
如何确定控制器中给定请求的IP地址?例如(快递):
app.post('/get/ip/address', function (req, res) {
// need access to IP address here
})
第2069篇《如何确定节点中的用户IP地址》来自Winter(https://github.com/aiyld/aiyld.github.io)的站点
相似问题
问题类别
Had the same problem...im also new at javascript but i solved this with req.connection.remoteAddress; that gave me th IP address (but in ipv6 format ::ffff.192.168.0.101 ) and then .slice to remove the 7 first digits.