1

I have a REST backend ( using Go ) and want to send notifications to the clients whenever something happened on the server side.

I don't want to cover message brokers here, I know they exist. Most people seem to solve this by using websockets. But you could also have an additional API endpoint to stream data ( e.g. notifications ) via application/x-ndjson ( of course clients will have to parse the streamed data ).

I would like to know why most people seem to favor websockets over HTTP streaming.

I think introducting a second "protocol" of communication comes with new problems, right? So why not just stick with HTTP streaming?

baitendbidz
  • 187
  • 3
  • 19

0 Answers0