Closed fenhl closed 1 year ago
For sign in with Discord or racetime.gg we will need a secure connection, so maybe the TCP connection should just be replaced entirely.
One problem with this is that it's not possible to do a “try-read” on a tungstenite WebSocket, i.e. return a message if one is available but don't block otherwise. Maybe it's time to rearchitect the Rust/C# FFI layer so a tokio runtime can be spawned on the Rust side and FFI communication happens via channels.
Implemented in a08804e9010b696480a0715502c1dd67777ab31a.
There should be a client setting to use a WebSocket connection, described as “uses slightly more data but more secure and may be allowed by more firewalls”. Additionally, the default setting should fall back to a WebSocket if direct TCP is not available.