A protocol options object that allows the user to configure the
WebSocket protocol for custom behavior.
Members (9)
get · iOS 13.0+
autoReplyPing
TypeScript
get autoReplyPing(): boolean
Swift declaration
var autoReplyPing: Bool { get set }
A boolean indicating whether the WebSocket protocol should
automatically reply to pings. If true, ping messages will
automatically be consumed by the connection instead of being
delivered to the user. The default setting is false.
set · iOS 13.0+
autoReplyPing
TypeScript
set autoReplyPing(value: boolean)
Swift declaration
var autoReplyPing: Bool { get set }
A boolean indicating whether the WebSocket protocol should
automatically reply to pings. If true, ping messages will
automatically be consumed by the connection instead of being
delivered to the user. The default setting is false.
get · iOS 13.0+
skipHandshake
TypeScript
get skipHandshake(): boolean
Swift declaration
var skipHandshake: Bool { get set }
A boolean indicating whether the WebSocket protocol should skip the
opening handshake and begin framing data as soon as the underlying
connection is established. The default setting is false.
This option should not be set when communicating with a generic
WebSocket server or client. This option allows a custom handshake
(or no handshake) to be implemented below the WebSocket layer
when both client and server are coordinated.
set · iOS 13.0+
skipHandshake
TypeScript
set skipHandshake(value: boolean)
Swift declaration
var skipHandshake: Bool { get set }
A boolean indicating whether the WebSocket protocol should skip the
opening handshake and begin framing data as soon as the underlying
connection is established. The default setting is false.
This option should not be set when communicating with a generic
WebSocket server or client. This option allows a custom handshake
(or no handshake) to be implemented below the WebSocket layer
when both client and server are coordinated.
Add to the list of supported application protocols that will be
presented to a WebSocket server during connection establishment.
This function will only take effect on WebSocket clients.
- Parameter subprotocols: An array of subprotocol strings.
get · iOS 13.0+
maximumMessageSize
TypeScript
get maximumMessageSize(): number
Swift declaration
var maximumMessageSize: Int { get set }
Set the maximum allowed message size to be received by the WebSocket
connection. This does not limit the sending message size.
A maximum message size of 0 means there is no receive limit. The
default maximum message size is 0.
set · iOS 13.0+
maximumMessageSize
TypeScript
set maximumMessageSize(value: number)
Swift declaration
var maximumMessageSize: Int { get set }
Set the maximum allowed message size to be received by the WebSocket
connection. This does not limit the sending message size.
A maximum message size of 0 means there is no receive limit. The
default maximum message size is 0.
Set additional HTTP header fields to be sent by the client during
the WebSocket handshake. This can be used for custom protocols and
cookies. Multiple headers of the same name are not allowed, and the
header will replaced by the most recently set value.
This function will only take effect on WebSocket clients.
- Parameter headers: An array of HTTP header names and values.