Socket.io-client-swift: How to pass the parameters on connect

Created on 18 Nov 2017  路  1Comment  路  Source: socketio/socket.io-client-swift

In javascript, we can do it like this:
const socket = io('http://localhost?token=abc');
but it doesn't work on your framework.

Most helpful comment

I knew it

let manager = SocketManager(socketURL: URL(string: "http://localhost:17111?abc=123")!,config: [.log(false), .compress, .connectParams(["token":"abc"])])

let socket = manager.defaultSocket

>All comments

I knew it

let manager = SocketManager(socketURL: URL(string: "http://localhost:17111?abc=123")!,config: [.log(false), .compress, .connectParams(["token":"abc"])])

let socket = manager.defaultSocket
Was this page helpful?
0 / 5 - 0 ratings