3 ms·
Right, but server-sent events work only one way: from server to client. gRPC allows you to create bi-directional streams, where both the client and server are p
by dguaraglia 9y ago
Right, but server-sent events work only one way: from server to client. gRPC allows you to create bi-directional streams, where both the client and server are pumping data.
Chunked encoding allows to do something like what gRPC does, but it's my understanding (I might be wrong) that the data needs to be base64 encoded, whereas HTTP/2 supports raw byte arrays to be sent.
- jkarneges 9y agoHTTP/1 responses carry raw bytes, and chunked encoding doesn't affect that (just some packet length prefixing). If you mean binary data would need to be Base64-encoded with server-sent events, that's true. SSE uses text/event-stream as the content type, which is expected to be text. It would be interesting if someone defined a content type for streaming binary events.