Show socket id in log if no ip available

master
Keith Irwin 2018-08-15 23:27:37 +00:00
parent 5d5b0928e0
commit 300bfe4371
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
1 changed files with 1 additions and 1 deletions

View File

@ -27,7 +27,7 @@ module.exports = {
init: (io) => {
io.on('connection', (socket) => {
debug(`${socket.ip} connected.`)
debug(`${socket.ip||socket.id} connected.`)
// Set a few variables
socket.ip = socket.client.request.headers['x-real-ip'];