franciscop / server

:desktop_computer: Simple and powerful server for Node.js
https://serverjs.io/
MIT License
3.56k stars 171 forks source link

Socket.use method #110

Closed byalpcngz closed 5 years ago

byalpcngz commented 5 years ago

Hello there my problem is related to socket I'm using user socket with extraheaders when using socket I can do this with the io.use method and I can disconnect the socket, but I could not do that with server.js

io.use((socket, next) => { let clientId = socket.handshake.headers['x-clientid']; if ( clientId === process.env.CLIENTID) { return next(); } return next(new Error('authentication error')); });

franciscop commented 5 years ago

Hi, thanks for the question. The issues tab in Github are reserved for issues about the library or talking about the library itself, not as a general support forum for any question that involves this library.

Javascript in Reddit might be of help. If you have any more specific issue after trying some solutions, https://stackoverflow.com/ might also be useful.