Skip to content

Commit c5f6c2b

Browse files
committed
Updated to handle user address when server behind other services
1 parent 218761d commit c5f6c2b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/realtime.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ function connection(socket) {
632632
//create user data
633633
users[socket.id] = {
634634
id: socket.id,
635-
address: socket.handshake.address,
635+
address: socket.handshake.headers['x-forwarded-for'] || socket.handshake.address,
636636
'user-agent': socket.handshake.headers['user-agent'],
637637
color: color,
638638
cursor: null,

0 commit comments

Comments
 (0)