mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: add socket.data.uid on connect
This commit is contained in:
@@ -76,6 +76,7 @@ Sockets.init = async function (server) {
|
||||
|
||||
function onConnection(socket) {
|
||||
socket.uid = socket.request.uid;
|
||||
socket.data.uid = socket.uid; // socket.data is shared between nodes via fetchSockets
|
||||
socket.ip = (
|
||||
socket.request.headers['x-forwarded-for'] ||
|
||||
socket.request.connection.remoteAddress || ''
|
||||
|
||||
Reference in New Issue
Block a user