Answers for "socket io query"

-1

socket io query

// Client side
const socket = io({
  query: { token: 'cde' }
});

// Server side
io.on('connection', (socket) => {
  let token = socket.handshake.query.token;
  
  // Do something...
});
Posted by: Guest on August-29-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language