Updated to handle user address when server behind other services

This commit is contained in:
Cheng-Han, Wu 2016-03-15 10:54:04 +08:00
parent 218761d6a1
commit c5f6c2bab3

View file

@ -632,7 +632,7 @@ function connection(socket) {
//create user data //create user data
users[socket.id] = { users[socket.id] = {
id: socket.id, id: socket.id,
address: socket.handshake.address, address: socket.handshake.headers['x-forwarded-for'] || socket.handshake.address,
'user-agent': socket.handshake.headers['user-agent'], 'user-agent': socket.handshake.headers['user-agent'],
color: color, color: color,
cursor: null, cursor: null,