Closed qbig closed 9 years ago
let socket = SocketIOClient(socketURL: "localhost:8080", opts: ["connectParams": ["thing": "value"]])
You could use connectParams
what's the object-c way to do this?
SocketIOClient* socket = [[SocketIOClient alloc] initWithSocketURL: @"localhost:8080" opts: @{@"connectParams": @{@"thing": @"value"}}];
Works! Thanks!
Updated for 2017
var socket = SocketIOClient(socketURL: URL(string: "localhost:8080")!, config: [.connectParams(["<key>" : "<value>"])])
Hi , I don't find socket io client with this params. Is there any alternative method to pass query parameters on connect method ?
@mohdsafadsaal The config stuff has moved to the SocketManager
in the latest version.
how to use connect parameters in swift 4
@nuclearace Can you please provide the demo using SocketManager
?
I am getting difficulty to connect to socket server with authorization header.
Appreciate your help!
@bdavid68 It's crude, but this shows some basic usage: https://github.com/nuclearace/socket.io-client-testing/blob/master/Sources/main.swift
Can just append "?token=xxx" to the socketio url?