feat: add socket.data.uid on connect

isekai-main
Barış Soner Uşaklı 1 year ago
parent effa60f2f3
commit f026e74038

@ -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 || ''

Loading…
Cancel
Save