Once a challenge is accepted and a game is made, open a broadcast stream for streaming game events. Users can then connect to this stream using sockets.
White and black player should have separate sockets for sending data to server. Server then responds on this sockets with events from the broadcast stream that are filtered so that only events triggered by the opponent are sent.
Sockets should be:
wss://<host>/wss/game/<game_id> for sending out all game events,
wss://<host>/wss/game/<game_id>/white for receiving events of white player and sending events generated by black player, and
wss://<host>/wss/game/<game_id>/black for receiving events of black player and sending events generated by white player.
Once a challenge is accepted and a game is made, open a broadcast stream for streaming game events. Users can then connect to this stream using sockets.
White and black player should have separate sockets for sending data to server. Server then responds on this sockets with events from the broadcast stream that are filtered so that only events triggered by the opponent are sent.
Sockets should be:
wss://<host>/wss/game/<game_id>
for sending out all game events,wss://<host>/wss/game/<game_id>/white
for receiving events of white player and sending events generated by black player, andwss://<host>/wss/game/<game_id>/black
for receiving events of black player and sending events generated by white player.