4 Protocol Examples

In the following example, an application is running in a controlled environment and performance is a crucial factor.

Because the application is running in a safe environment, the administrator disables masking as follows to improve performance:

  1. The administrator changes the configuration of the client and server applications to disable masking.

  2. When the server application initializes the WebSocket Protocol [RFC6455] for a given endpoint, the WebSocket Protocol server is instructed by the application to disable masking for the endpoint. The server sets the value of the accept-unmasked-frame ADM element to TRUE.

  3. When the client application initializes the WebSocket Protocol for a given connection, the WebSocket Protocol client is instructed by the application to disable masking on the connection. The client sets the value of the set-mask-to-zero ADM element to TRUE.

  4. When the client application sends data, the WebSocket Protocol client uses a masking-key of zero. Doing an XOR with zeroes results in the data being left unmodified.

  5. When the WebSocket server receives such data, the message is delivered to the server application although the data was not masked.