WebSocketsDifferences between WebSockets and AJAX


Introduction

Ajax uses the HTTP Protocol and can send requests using POST/GET methods from Client to Server.

WebSocket is itself a protocol to communicate between Client and Server, distinct from HTTP.

In Ajax when you send a request , server sends response for that request and connection ends.

Using WebSockets when you establish a connection with server , then you can communicate between client and server as much you want and it keeps connection alive.