connectrpc / connect-es

The TypeScript implementation of Connect: Protobuf RPC that works.
https://connectrpc.com/
Apache License 2.0
1.32k stars 75 forks source link

Add bidirectional stream support #419

Closed euskadi31 closed 1 year ago

euskadi31 commented 1 year ago

Is your feature request related to a problem? Please describe.

Using bidirectional stream.

Describe the solution you'd like

I think you could use the Websocket to be able to support this feature

Describe alternatives you've considered

See: https://github.com/bufbuild/connect-web/issues/416

timostamm commented 1 year ago

Axel, the idea is that one simple protocol should be good enough for all clients. We decided against WebSockets because they would add much complexity to the very simple Connect protocol. Note that there has been some movement with browser support for better streaming support, for example in Chrome, and with the WebTransport API.

For select use cases you need now, it should be very feasible to implement a client Transport that uses WebSockets under the hood, and to add a WebSocket route on the server that calls the service implementation. It's definitely not a turn-key solution, but streaming rarely is, and you can still benefit from the protobuf schema.

For those reasons, we currently do not plan to support bidi streaming via WebSockets.