无法在sails.js中获取远程IP地址?

时间:2014-01-27 05:03:08

标签: node.js sails.js

我正在获取链接,但如何使用它。 http://nodejs.orgapitls.html#tls_class_tls_cleartextstream

1 个答案:

答案 0 :(得分:0)

var io = require(“socket.io”)。listen(server);

io.sockets.on(“connection”,function(socket){

var address = socket.handshake.address;

console.log("New connection from " + address.address + ":" + address.port);

}

检查一下.. http://nodejs.org/api/all.html#all_socket_address