midoshouse / ootr-multiworld

An alternative implementation of multiworld for the Ocarina of Time randomizer
https://midos.house/mw
MIT License
9 stars 1 forks source link

Support WebSocket connections #2

Closed fenhl closed 1 year ago

fenhl commented 2 years ago

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.

fenhl commented 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.

fenhl commented 1 year ago

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.

fenhl commented 1 year ago

Implemented in a08804e9010b696480a0715502c1dd67777ab31a.