WebSocket

WebSocket is a standard protocol that enables a web browser or client application, and a web server application to use a full-duplex connection to communicate. The product supports the WebSocket 1.1 specification, which builds on the 1.0 specification to provide a more robust way of specifying message handlers.

HTTP is not designed for long-lived, real-time, full duplex communication between two applications. In many instances, your web server application or servlet wants to communicate with a client browser or application in a long-lived, real-time, full duplex conversation. The two applications want to freely read and write data back and forth. An example is an application that constantly displays changing currency exchange rates on the web browser of a stock trader. Current HTTP technical solutions for this type of communication are cumbersome and inefficient. HTTP solutions for constant two-way communication between a browser and a server mostly consists of either polling or two open HTTP connections that handle one-way traffic only, or both.

WebSocket uses a standard HTTP request-response sequence to establish a connection. When the connection is established, the WebSocket API provides a read-and-write interface for reading and writing data over the established connection in an asynchronous full duplex manner. WebSocket also provides an interface for asynchronously closing the connection from either side.

Because WebSocket uses a standard HTTP request-response sequence to establish a connection, the connection initiation connects though firewalls and proxies in the same manner as an HTTP connection. WebSocket requires full duplex communication, including simultaneous reads and writes on the same connection. The product web server plug-in supports full duplex communication, but other firewalls and proxies might require modification to enable this support. WebSocket can also use SSL for secure connections and transmission of data. This protocol uses SSL in the same way that the HTTP protocol uses SSL.

The WebSphere® Application Server traditional WebSocket feature implements the following specifications: