WebSockets is a communications protocol (https://en.wikipedia.org/wiki/Communication_protocol) that provides full-duplex (https://en.wikipedia.org/wiki/Duplex_(telecommunications)#FULL-DUPLEX) communication channels over a single TCP connection between client and server. It allows clients to send messages to the server and receive server events over the same TCP connection without polling. Compared to Server-Sent Events (SSE) (https://www.w3.org/TR/eventsource/), WebSockets support full-duplex communication between client and server instead of a one-way push. Also, SSEs are implemented over HTTP, which is an entirely different TCP protocol compared to WebSocket. Although both protocols are different, they both depend on the TCP layer.
Note
RFC 6455 (https://tools.ietf.org/html/rfc6455) states that WebSocket is designed to work over HTTP ports 80 and 443 as well as to support HTTP proxies and intermediaries, thus making it compatible with the HTTP protocol. To achieve compatibility...