-
Notifications
You must be signed in to change notification settings - Fork 854
Closed
Description
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!