subprotocol
TypeScriptget subprotocol(): (string) | nullSwift declarationlet subprotocol: String?The subprotocol selected by the server.
struct · iOS 13.0+ · SDK 27.1
struct ResponseA server response to a WebSocket client's request to connect.
get subprotocol(): (string) | nullSwift declarationlet subprotocol: String?The subprotocol selected by the server.
get additionalHeaders(): (Array<{ "name": string; "value": string }>) | nullSwift declarationlet additionalHeaders: [(name: String, value: String)]?Any additional headers to include in the server's response.
static init(status: NWProtocolWebSocket_Response_Status, subprotocol?: (string) | null, additionalHeaders?: (Array<{ "name": string; "value": string }>) | null): NWProtocolWebSocket_ResponseSwift declarationinit(status: NWProtocolWebSocket.Response.Status, subprotocol: String?, additionalHeaders: [(name: String, value: String)]? = nil)Create a server response to a WebSocket client's request to connect. - Parameter status: The status of the response. If the status is .accept, the server will accept the handshake and open the WebSocket connection. If the status is .reject, the server will reject the handshake and respond with the HTTP error 400 Bad Response. - Parameter subprotocol: The server's selected protocol from the client's list of proposed subprotocols. If the status of this response is .reject, this parameter is ignored. Pass nil to indicate the server did not find a suitable subprotocol, but has accepted the handshake anyways. Passing an empty string is prohibited by the WebSocket protocol. - Parameter additionHeaders: Any additional headers to include in the server's response.
get status(): NWProtocolWebSocket_Response_StatusSwift declarationlet status: NWProtocolWebSocket.Response.StatusThe status of the server's response.
No declarations were skipped in this snapshot.