WebSocket - s50600822/Notes GitHub Wiki

Desc

WebSockets are used for real-time communication between a client and a server. They provide a persistent, bi-directional communication channel between a client (typically a web browser) and a server. Unlike traditional HTTP requests, which are stateless and disconnected after each request, a WebSocket connection remains open and allows both the client and the server to send data to each other at any time. This makes it a great choice for applications that require real-time updates, such as chat applications, online gaming, stock market tickers, and other similar applications.

Issues

https://gist.github.com/subudeepak/9897212

Increased server load: WebSockets keep the connection open between the client and server, which can put additional load on the server, especially when dealing with a large number of clients.

Increased network bandwidth: Unlike traditional HTTP requests, WebSockets keep the connection open, which can result in increased network bandwidth usage.

Connection disruptions: WebSockets can be affected by network disruptions, such as intermittent connectivity or network latency issues. This can cause the connection to drop or become unstable, resulting in lost data.

Security concerns: WebSockets can expose security vulnerabilities, such as cross-site scripting (XSS) attacks or injection attacks. It is important to ensure that WebSocket connections are secured using encryption and authenticated using a secure authentication mechanism.

Browser support: Not all browsers support WebSockets, and some older browsers may not support the latest versions of the WebSocket protocol. This can make it difficult to provide a consistent user experience across different devices and platforms.