let socket = WebSocket(url: URL(string: "wss://api.lionshare.capital")!)
Have tested on HTML it connects correctly, but when I use Starscream, I get the Invalid HTTP upgrade error. Do you have any suggestions on how to debug the issue? Or are there any iOS specific settings / formats it needs to adhere too?
Using Starscream:2.0.3 XCode:8.2.1.
Invalid upgrade comes from the server when it fails to upgrade the HTTP/TCP connection to a WebSocket connection. I would double check your url, your headers and such, so the server has the correct info to properly upgrade the connection. If that looks correct, I would suggest a packet capture to see what the differences, so you can make the needed code changes to match. Also be sure to check your Origin header, as most WebSocket servers will reject any connection that doesn't match.
Most helpful comment
Invalid upgrade comes from the server when it fails to upgrade the HTTP/TCP connection to a WebSocket connection. I would double check your url, your headers and such, so the server has the correct info to properly upgrade the connection. If that looks correct, I would suggest a packet capture to see what the differences, so you can make the needed code changes to match. Also be sure to check your Origin header, as most WebSocket servers will reject any connection that doesn't match.