You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some environments still block WebSocket connections. We already have a POST endpoint for sending updates, so it would be cool if we could pair that with a streaming HTTP endpoint.
One way it could work is that the client would send a POST request to the /as-stream endpoint, containing its state vector. The server would stream back updates in binary format, and the client would read them.
We would need to implement some form of framing inside the HTTP stream, since it is just a stream of bytes. We would also need to implement a way of detecting a blocked WebSocket connection and attempt a fetch connection instead.
The initial handshake with this method would only synchronize server state to the client, not client state to the server. To send client state to the server, we could implement a /state-vector endpoint that returns the server's current state vector, and then have the client send a POST request to the /update endpoint containing any local updates.
Alternately, if our own provider becomes more stateful, we could just emulate the stateful connection over POST messages up to the server and streaming messages down to the client.
The text was updated successfully, but these errors were encountered:
Some environments still block WebSocket connections. We already have a
POST
endpoint for sending updates, so it would be cool if we could pair that with a streaming HTTP endpoint.One way it could work is that the client would send a
POST
request to the/as-stream
endpoint, containing its state vector. The server would stream back updates in binary format, and the client would read them.We would need to implement some form of framing inside the HTTP stream, since it is just a stream of bytes. We would also need to implement a way of detecting a blocked WebSocket connection and attempt a fetch connection instead.
The initial handshake with this method would only synchronize server state to the client, not client state to the server. To send client state to the server, we could implement a
/state-vector
endpoint that returns the server's current state vector, and then have the client send aPOST
request to the/update
endpoint containing any local updates.Alternately, if our own provider becomes more stateful, we could just emulate the stateful connection over
POST
messages up to the server and streaming messages down to the client.The text was updated successfully, but these errors were encountered: