websocket-client
websocket-client copied to clipboard
Cannot connect to websocket over HTTPS
I spent a few days preparing my WPF app for websocket connections, and I now can't go any further because I discovered the library can't connect to anything other than ws://
or wss://
(would've been nice for this to be documented somewhere 😞 )
What can I do about this? Surely there's some way around this?
This was the most recommended package for client connections, and looking at others on NuGet, they haven't been updated in years...
This is kinda basic and got nothing to do with the library. https is for http traffic, not websocket traffic. when you want to use secure websockets, use wss://
This is kinda basic and got nothing to do with the library. https is for http traffic, not websocket traffic. when you want to use secure websockets, use wss://
I am aware this is basic, and I'm aware of the "typical" uses of the protocols... However, the socket I was connecting into only documents https://
connections: https://dev.streamlabs.com/docs/socket-api
When connecting into this socket API using SocketIO in NodeJS, the https
protocol is supported (as the example shows).
I was asking whether this library has support similar to that. Your suggestion of simply using wss://
is not helpful, as you said yourself they are nothing alike, so just replacing the protocol with wss://
is not going to work.
FWIW, I eventually managed to find someone that had managed to find the underlying websocket which wasn't documented, which meant decoding the data and parsing event types manually:
new Uri($"wss://sockets.streamlabs.com/socket.io/?token={token}&transport=websocket"