Last active
December 21, 2015 17:08
-
-
Save ryuone/6338358 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var socketio = require("socket.io"); | |
io.sockets.on("connection", function (socket) { | |
// Get client's ip address. | |
console.dir(socket.manager.handshaken[socket.id].address.address) | |
// Get client's user-agent. | |
console.dir(socket.manager.handshaken[socket.id].headers['user-agent']) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment