pages apart from index.html dont connect to socket .io #4544
-
i was mixing and matching few example in docs WebSocket connection to 'ws://localhost:4000/socket.io/?EIO=4&transport=websocket&sid=Xr6J7yHGyTYv75bzAAA6' failed: WebSocket is closed before the connection is established sources that i am working with are at |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It seems there is a typo in the agent.html file: socket.auth = { username } Instead of: socket.auth = { user_name } in the index.html So the middleware here prevents the connection and closes the WebSocket connection: const username = socket.handshake.auth.user_name;
if (!username) {
return next(new Error("invalid username"));
} Could you please check? |
Beta Was this translation helpful? Give feedback.
It seems there is a typo in the agent.html file:
Instead of:
in the index.html
So the middleware here prevents the connection and closes the WebSocket connection:
Could you please check?