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
After upgrading the server to v3.1.0 and using the allowEIO3: true option the client socket v2.2.0 cannot connect to the indicated namespace anymore.
socket.io:server creating engine.io instance with opts {"allowEIO3":true,"cors":{"credentials":true,"methods":["GET","POST"],"origin":["https://localhost:4200","http://10.0.2.2:4200"],"transports":["websocket","polling"]},"path":"/socket.io"} +0ms
socket.io:server initializing namespace /frontend +0ms
socket.io:client connecting to namespace / +0ms
engine:ws received "40/frontend?sessionId=2053f60c072e0749d141112ddc851e00942785d7&revision=develop," +1ms
socket.io-parser decoded 0/frontend?sessionId=2053f60c072e0749d141112ddc851e00942785d7&revision=develop, as {"type":0,"nsp":"/frontend?sessionId=2053f60c072e0749d141112ddc851e00942785d7&revision=develop"} +3ms
socket.io:client creation of namespace /frontend?sessionId=2053f60c072e0749d141112ddc851e00942785d7&revision=develop was denied +3ms
socket.io:client writing packet {"type":4,"nsp":"/frontend?sessionId=2053f60c072e0749d141112ddc851e00942785d7&revision=develop","data":{"message":"Invalid namespace"}} +0ms
The client connects to the URL https://localhost:3700/frontend?sessionId=2053f60c072e0749d141112ddc851e00942785d7&revision=develop
When the query parameters are removed the connection to /frontend succeeds.
Server v2.2.0 was working fine with the query parameters.
Any thoughts?
The text was updated successfully, but these errors were encountered:
In Socket.IO v2, the Socket query option was appended to the namespace
in the CONNECT packet:
{
type: 0,
nsp: "/my-namespace?abc=123"
}
Note: the "query" option on the client-side (v2) will be found in the
"auth" attribute on the server-side:
```
// client-side
const socket = io("/nsp1", {
query: {
abc: 123
}
});
socket.query = { abc: 456 };
// server-side
const io = require("socket.io")(httpServer, {
allowEIO3: true // enable compatibility mode
});
io.of("/nsp1").on("connection", (socket) => {
console.log(socket.handshake.auth); // { abc: 456 } (the Socket query)
console.log(socket.handshake.query.abc); // 123 (the Manager query)
});
More information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/#Add-a-clear-distinction-between-the-Manager-query-option-and-the-Socket-query-option
Related: #3791
In Socket.IO v2, the Socket query option was appended to the namespace
in the CONNECT packet:
{
type: 0,
nsp: "/my-namespace?abc=123"
}
Note: the "query" option on the client-side (v2) will be found in the
"auth" attribute on the server-side:
```
// client-side
const socket = io("/nsp1", {
query: {
abc: 123
}
});
socket.query = { abc: 456 };
// server-side
const io = require("socket.io")(httpServer, {
allowEIO3: true // enable compatibility mode
});
io.of("/nsp1").on("connection", (socket) => {
console.log(socket.handshake.auth); // { abc: 456 } (the Socket query)
console.log(socket.handshake.query.abc); // 123 (the Manager query)
});
More information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/#Add-a-clear-distinction-between-the-Manager-query-option-and-the-Socket-query-option
Related: socketio#3791
Describe the bug
After upgrading the server to v3.1.0 and using the
allowEIO3: true
option the client socket v2.2.0 cannot connect to the indicated namespace anymore.The client connects to the URL
https://localhost:3700/frontend?sessionId=2053f60c072e0749d141112ddc851e00942785d7&revision=develop
When the query parameters are removed the connection to
/frontend
succeeds.Server v2.2.0 was working fine with the query parameters.
Any thoughts?
The text was updated successfully, but these errors were encountered: