WebSockets vs. Server-Sent events/EventSource

后端 未结 6 993
清歌不尽
清歌不尽 2020-11-22 02:00

Both WebSockets and Server-Sent Events are capable of pushing data to browsers. To me they seem to be competing technologies. What is the difference between them? When would

6条回答
  •  一个人的身影
    2020-11-22 02:30

    One thing to note:
    I have had issues with websockets and corporate firewalls. (Using HTTPS helps but not always.)

    See https://github.com/LearnBoost/socket.io/wiki/Socket.IO-and-firewall-software https://github.com/sockjs/sockjs-client/issues/94

    I assume there aren't as many issues with Server-Sent Events. But I don't know.

    That said, WebSockets are tons of fun. I have a little web game that uses websockets (via Socket.IO) (http://minibman.com)

提交回复
热议问题