📜  socket io 获取 ip - Javascript 代码示例

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

代码示例1
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);
});