Home  >  Article  >  Web Front-end  >  Comparison between EventSource and WebSocket encapsulated using HTML5 server-side events

Comparison between EventSource and WebSocket encapsulated using HTML5 server-side events

PHPz
PHPzforward
2023-08-30 23:41:10882browse

Comparison between EventSource and WebSocket encapsulated using HTML5 server-side events

The event source is just a web socket, -

  • Unable to send data
  • Use text or event stream format
  • The events it triggers are server-defined

It is useful in applications that only require server push.

Web Sockets are suitable for applications that require fast two-way communication.

Another major difference is the different security models they use.

Server Sent Events For-

  • Live Subscription
  • Live Scores
  • Stock Market Updates

The above is the detailed content of Comparison between EventSource and WebSocket encapsulated using HTML5 server-side events. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:tutorialspoint.com. If there is any infringement, please contact admin@php.cn delete