WebSocket Options

Configure options for connections that use WebSocket.

Topics

Creating WebSocket Connections

nw_protocol_copy_ws_definition

Accesses the system definition of the WebSocket protocol.

nw_ws_create_options

Initializes a default set of WebSocket connection options.

nw_ws_version_t

Supported versions of the WebSocket protocol.

nw_ws_options_set_auto_reply_ping

Configures the connection to automatically reply to Ping messages instead of delivering them to you.

nw_ws_options_set_maximum_message_size

Sets the maximum allowed message size, in bytes, to be received by the WebSocket connection.

Configuring Client Handshakes

nw_ws_options_add_additional_header

Adds additional HTTP header fields to be sent by the client during the WebSocket handshake.

nw_ws_options_add_subprotocol

Adds to the list of supported application protocols that will be presented to a WebSocket server during connection establishment.

nw_ws_options_set_skip_handshake

Specifies whether the WebSocket protocol skips its handshake and begins framing data once the underlying connection is established.

Handling WebSocket Messages

nw_protocol_metadata_is_ws

Checks whether a metadata object represents a WebSocket message.

nw_ws_create_metadata

Initializes a WebSocket message with a specific type code.

nw_ws_metadata_get_opcode

Checks the type code on a WebSocket message.

nw_ws_opcode_t

Types of messages that you send and receive on a WebSocket connection.

nw_ws_metadata_set_close_code

Sets a close code on a WebSocket message.

nw_ws_metadata_get_close_code

Accesses the close code on a WebSocket message.

nw_ws_close_code_t

Types of codes used upon closing a WebSocket connection.

nw_ws_metadata_set_pong_handler

Sets a handler on a Ping message to be invoked when the corresponding Pong message is received.

nw_ws_pong_handler_t

A handler that indicates that a Pong message has been received for a previously sent Ping message, or that an error was encountered.

nw_ws_metadata_copy_server_response

Accesses the WebSocket server's response sent during the handshake.

Handling Server Handshakes

nw_ws_options_set_client_request_handler

Sets a handler to react to as a server to inbound WebSocket client handshakes.

nw_ws_client_request_handler_t

A handler that delivers inbound client handshake requests.

nw_ws_request_t

A WebSocket handshake request sent from a client to a server.

nw_ws_request_enumerate_subprotocols

Enumerates the supported subprotocols in a WebSocket message.

nw_ws_subprotocol_enumerator_t

A block that enumerates the supported subprotocols in a WebSocket client request.

nw_ws_request_enumerate_additional_headers

Enumerates additional HTTP headers in a WebSocket message.

nw_ws_additional_header_enumerator_t

A block that enumerates additional HTTP headers in a WebSocket client request.

nw_ws_response_t

A WebSocket handshake reponse sent from a server to a client.

nw_ws_response_create

Initializes a WebSocket server response with a status and selected subprotocol.

nw_ws_response_status_t

Status values that are sent with a WebSocket server response.

nw_ws_response_add_additional_header

Adds an additional HTTP header to a WebSocket server response.

nw_ws_response_get_status

Accesses the status of a WebSocket server response.

nw_ws_response_get_selected_subprotocol

Accesses the selected subprotocol in a WebSocket server response.

nw_ws_response_enumerate_additional_headers

Enumerates the additional HTTP headers in a WebSocket server response.

See Also

Network Protocols

TCP Options

Configure options for connections that use the Transmission Control Protocol.

TLS Options

Configure options for connections that use Transport Layer Security.

UDP Options

Configure options for connections that use the User Datagram Protocol.

IP Options

Configure Internet Protocol options on connections.

Framer Protocol Options

Create custom protocols to frame applications messages over a connection.