WebSocketUpgrade Event 841
Applies To: HTMLRenderer

Description

This event is reported when the client component of an HTMLRenderer object opens a WebSocket and the requested URL matches a pattern specified by the InterceptedURLs property. If there is no match, the connection request is processed as an external request by the Chromium Embedded Framework (CEF).

The protocol for establishing the connection is handled internally then this event is reported when the connection has been made. The WebSocket ID is subsequently required to send a message by calling the WebSocketSend method or to close the connection using the WebSocketClose method. Note that several WebSocket connections may be made concurrently. Should the connection fail, a WebSocketError event will be reported instead.

The event message reported as the result of ⎕DQ, or supplied as the right argument to your callback function, is a 4-element vector as follows:

[1] Object ref or character vector
[2] Event 'WebSocketUpgrade' or 841
[3] ID Character vector containing the ID of the WebSocket
[4] URL The requested url of the WebSocket

Example

┌→────────────────────────────────────────────────────────┐
│      ┌→───────────────┐ ┌→──────────────┐ ┌→──────────┐ │
│ #.hr │WebSocketUpgrade│ │5d61d8330065608│ │ws://myapp/│ │
│      └────────────────┘ └───────────────┘ └───────────┘ │
└∊────────────────────────────────────────────────────────┘