-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Open
Labels
Description
Describe the bug
Unable to pass a path or a namespace to socket.io-client
.
const client = io(`https://test.com/namespace`, { path: 'something/else' });
-
GIVEN:
namespace
is stripped away, attempt to establish connection tohttps://test.com/something/else
. -
EXPECTED: Presever
namespace
and establish connection tohttps://test.com/namespace/something/else
To Reproduce
Server
Introduce a Namespace
- // Server built via
NestJS
{
"@nestjs/platform-socket.io": "^11.1.5",
"socket.io": "^4.8.1"
}
@WebSocketGateway({ path: 'something/else', namespace: 'namespace' })
export class EventsGateway implements OnGatewayInit, OnGatewayConnection {
Browser
import { io } from "socket.io-client";
const socket = io(`https://test.com/namespace`, {
path: 'something/else'
});
Expected behavior
- Establish Connection
Platform:
- Device: Apple Silicon
- OS: Mac Os 15.5
Additional context
- prepending the
/namespace
to the path doesn't work either.
The issue could be here, there seems to be no concept of namespace.