WebSocket is a new technology that is part of HTML5. It allows a browser (or an application that uses HTTP/HTTPS) to upgrade a HTTP/HTTPS connection to a full socket to the server so that both parties can send data at any time.
The WebSocket protocol is defined in RFC 6455. The initial handshaking is a HTTP request with upgrade header like the following from the RFC:
GET /chat HTTP/1.1