Contents
Should I use WebSockets for notifications?
Think of all the applications that we use to send messages or to receive live, up-to-date notifications in a single day. WebSockets are a useful tool for building web applications that need to provide these instant, real-time updates and communication.
What did people use before WebSockets?
Soon there was a requirement for the Internet client, the web browser, to be more dynamic, for it to offer a richer experience. This was achieved through browser scripting in the form of VBScript and JavaScript and was known as Dynamic Hyper Text Markup Language (DHTML).
What are the disadvantages of using WebSockets?
But if you are creating a service that only you are going to consume in a controlled environment, the only disadvantage might be that not every client supports websockets, while pretty much any type of environment can do a simple http call. Highly active question.
How is a WebSocket connection initiated in a server?
First of all, a WebSocket communication is initiated through HTTP communication via the WebSocket handshake. The client tells the server that it wants to initiate a WebSocket connection: If the server accepts the connection, it answers the following way:
Is the WebSocket handshake vulnerable to CSRF?
In fact, the Cross-Site WebSocket Hijacking attack is possible when the WebSocket handshake is vulnerable to CSRF. Indeed, the communication channel between the two parties (client/server) is created according to the origin of the opening request.
How is a WebSocket different from an HTTP request?
Indeed, with the HTTP protocol, the client initiates a request and waits for a response, this is called a transaction. Each request/response initiates a different transaction, whereas a WebSocket initiates a transaction with a long-life cycle (several requests/responses). In addition, the server can send data even if no prior request has been made.