You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Im setting up the server in my springboot application and nodejs application (not simaltaneously) both and my client in nodejs.
When I set the auth token on my client(in node application) and server is also in node it works fine and the authToken object is found in the handshake but if I run the server in my springboot application, authToken object is null.
To Reproduce
Please fill the following code example:
Server
socketIOServer.addConnectListener(new ConnectListener() {
@Override
public void onConnect(SocketIOClient client) {
Object jwtToken = client.getHandshakeData().getAuthToken(); // null here
}
}
Socket.IO client version: x.y.z
Client
constio=require('socket.io-client');// Connect to the server with custom headersconstsocket=io('http://localhost:8081',{auth: {token: 'eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0LGpvaG5kb2VAZXhhbXBsZS5jb20iLCJpYX'},});// Handle connection eventsocket.on('connect',()=>{console.log('Connected to server');});// Handle custom events from the serversocket.on('message',(data)=>{console.log('Received message from server:',data);});// Emit custom events to the serversocket.emit('chatMessage','Hello, server!');
Expected behavior
Expect springboot tocatch the authToken in handshake
Platform:
-MacOs
Additional context
Query params when set are being properly found in url params of the handshake, but authtoken isnt
The text was updated successfully, but these errors were encountered:
Describe the bug
Im setting up the server in my springboot application and nodejs application (not simaltaneously) both and my client in nodejs.
When I set the auth token on my client(in node application) and server is also in node it works fine and the authToken object is found in the handshake but if I run the server in my springboot application, authToken object is null.
To Reproduce
Please fill the following code example:
Server
Socket.IO client version:
x.y.z
Client
Expected behavior
Expect springboot tocatch the authToken in handshake
Platform:
-MacOs
Additional context
Query params when set are being properly found in url params of the handshake, but authtoken isnt
The text was updated successfully, but these errors were encountered: