For a push server, Server-Sent Events is a better choice than WebSockets. GitHub uses SSE to automatically display new comments, download requests, etc.
SSE is HTTP compatible, so it will work with proxies, and you wonโt need HTTPS to work in practice (for example, a large number of mobile operators have an HTTP proxy that breaks unencrypted WebSockets, but SSE works fine) .
SSE connection is easy and fast. There is no additional procedure for establishing a connection and connection. If you have SSE on every page, your server will work less.
The SSE protocol is very simple. You do not need a dedicated web server or library, and it can be polyfilled for older browsers.
source share