Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stream data with Node.js HTTP API or Websockets?

With node.js i can stream data to the client with its HTTP API. But when do I want to use HTTP to stream data and when do i want to use node.js sockets.io to do streaming?

like image 843
ajsie Avatar asked Oct 20 '25 22:10

ajsie


1 Answers

I would use Socket.IO universally because it cleverly selects the most appropriate transport method for performing IO based on what's available to the browser.

like image 137
entropo Avatar answered Oct 22 '25 13:10

entropo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!