7 TransportProtocols ToC Previous Next

7.5 WebSockets ToC Previous Next

7.5.2 Protocol Mapping ToC Previous Next

The WebSocket protocol allows clients to request that servers use specific sub-protocols with the “Sec-WebSocket-Protocol” header in the WebSocket handshake defined in RFC 6455. The protocols defined by this standard are shown in Table 56.

Table 56 – WebSocket Protocols Mappings

Protocol Description
opcua+uacp Each WebSocket frame is a MessageChunk as defined in 6.7.2. After the WebSocket is created, the handshake described in 7.1.3 is used to negotiate the maximum size of the MessageChunk. The maximum size for a buffer needed to receive a WebSocket frame is the maximum length of a MessageChunk plus the maximum size for the WebSocket frame header.
When using this protocol the payload in each frame is binary (OpCode 0x2 in RFC 6455).
opcua+uajson Each WebSocket frame is a Message encoded using the JSON encoding described in 5.4.9. There is no mechanism to negotiate the maximum frame size. If the receiver encounters a frame that exceeds its internal limits it shall close the WebSocket connection and provide a 1009 status code as described in RFC 6455.
When using this protocol the payload in each frame is text (OpCode 0x1 in RFC 6455).

Each WebSocket protocol mapping defined has a TransportProfileUri defined in OPC 10000-7.

The Client shall request a protocol. If the Server does not support the protocol requested by the Client, the Client shall close the connection and report an error.

Previous Next