Socket.IO-Client-Swift
Socket.IO-Client-Swift copied to clipboard
Socket connection not established
Hi,
I'm trying to reproduce a socket connetion I did in javascript using swift, but I'm getting "Invalid HTTP upgrade" error message
- My Swift Socket IO Options are the following:
let options = [ .ForceWebsockets(true), .ForcePolling(true) .ForceNew(true), .Reconnects(false), .Secure(true), .Path("/socket"), .Log(true) ] - The options which are working in JavaScript are:
const ioptions = { transports: ['websocket'], 'force new connection': true, reconnect: true, secure: true, path: '/socket', jsonp: false };
Could you please suggest what I'm doing wrong, and is there a swift alternative for the "jsonp" I was using in javascript?
Thank you.
For your path try "/socket/"
Thank you for the answer. It's working now 👍