Skip to content

Cant connect to socket with namespace in version 13.1.0 #923

@vsergeev1988

Description

@vsergeev1988

Hi there! I am trying to connect the websocket on the backend using the latest 13.1.0. Here is my source code:

    let manager: SocketManager

    required init() {
        self.manager = SocketManager(socketURL: Consts.Api.apiUrl,
                config: [SocketIOClientOption.path("/api/v1/communication/socket.io"),
                         SocketIOClientOption.log(true),
                         SocketIOClientOption.extraHeaders(
                                 ["Authorization": "<auth token>"]
                         )])
    }

    func connect() {
        let namespaceSocket = self.manager.socket(forNamespace: "/testRoom1")
        self.addHandlers(namespaceSocket)
        namespaceSocket.connect()
    }

Unfortunately, I receive an error from the backend:

Error decoding socket IO packet '0/testRoom1': Expected ',' to end namespace declaration

Maybe "," is missed in -[SocketManager connectSocket:] where connection command is creating, just like "," is adding after namespace in [SocketPacket createPacketString] method?
Same for -[SocketManager disconnectSocket:].

Or maybe I have an error in my code?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions