Connecting to JADE Applications using the WebSocket Protocol

JADE supports the WebSocket communications protocol, which enables interaction between a web client (such as a browser) and a JADE server‑side application, facilitating real‑time data transfer from and to the server. This is made possible by providing a standardized way for the JADE server‑side application to send content to the client without being first requested by the client, and allowing messages to be passed back and forth while keeping the connection open. In this way, a two‑way ongoing conversation can take place between the client and server‑side application.

The protocol consists of an opening handshake followed by basic message framing, layered over TCP. This provides browser‑based applications that need two‑way communication with servers to do so without relying on opening multiple HTTP connections.

IIS has to be correctly configured to handle incoming WebSocket connections and forward requests that will be handled by JADE to the JadeWebSocketModule (that is, the JadeWebSockets_IIS.dll native IIS module).

A JadeWebSocketModule instance loaded into an IIS worker process maps WebSocket connections to JADE application instances using URL pattern‑matching rules that yield a host (network name or IP address) and TCP port number.

The WebSocket protocol is not supported by JADE applications connected to an Apache HTTP Server.

A simple message protocol is used to multiplex the WebSocket sessions and their messages over each JADE application TCP connection, as shown in the following diagram.

As IIS is typically configured to run multiple worker processes, multiple instances of the JadeWebSocketModule can be active at the same time, so JADE applications must support multiple TCP connections.

2018.0.01 and higher

For details about configuring the WebSocket protocol, see "Configuring the WebSocket Module", later in this chapter. See also the See also the JadeWebSocket, JadeWebSocketServer, and WebSocketException classes in Volume 2 of the JADE Encyclopaedia of Classes.