-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable candidate exchange via REST + SSE #19
Comments
TL;DR; as an option Xirsys is offering Signaling servers.
There are some questions about security, garbage collection (delete channels after some time) and how long a token should be valid, but nothing that is impossible to implement. Downside is the complexity shift to the ice breaker (needs to know all game + users) needs persistence (redis?) to store tokens and games, and also needs to make some more requests to xirsys. The ICE Adapter also has to make adjustments on how to talk to the signaling server, but also nothing to complicated. PS: don't really know what is better, own server vs xirsys, both having pros/cons |
Background information
In order for the ICE protocol to work, the local candidates of an ICE adapter need to be sent to all other users that want to connect.
Currently this is done between lobby server [1] and faf client GpgnetMessage
iceMsg
[2] [3]. However, this has nothing to do with real Gpgnet protocol (lobby<->game). A better place would be a direct icebreaker<->ice-adapter communication.Solution
(work in progress)
All ice adapters subscribe to an event stream (SSE) where candidate information is exchanged. (Hint: In a distributed system, these can be across multiple instances). When an ice-adapter tries to join a session, it can subscribe to an event stream (SSE) where remote peer candidates are being published.
Therefore on every connection attempt (might be reconnect too) can post to
/game/{gameId}/candidates
with the candidates as a payload. This POST triggers the candidates to be sent to all other session peers. This post must be marked with a request id, on which all other ice adapters should send a fresh response to the same request id (potential caching is up to the ice adapters).All messages on the SSE must be sent via RabbitMQ so all icebreaker instances can forward them to SSE-session attached to this game.
The text was updated successfully, but these errors were encountered: