hyperledger / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
433 stars 277 forks source link

Proposal: use Server-Sent Events instead of WebSocket #4910

Open 0x009922 opened 1 month ago

0x009922 commented 1 month ago

WebSocket is overkill for Events and Block Stream APIs - they aren't bidirectional. Server-Sent Events is a simpler and more robust HTTP-native alternative (e.g. used by ChatGPT streaming responses).

Benefits:

Downsides:

DCNick3 commented 1 month ago

Text-only seems like a big showstopper to me. One alternative I can see is to use own own event streaming format, with support for binary events (and probably without event id?).

AFAIU, you still can handle that in the browser environment with fetch API. We'd have to implement the reconnection ourselves though..