I’m trying to figure it out how a ws client can read additional headers set by the WebSocket server during the handshake.
Websocket Server (built using the NWProtocolWebSocket)
Websocket Client (built using the NWProtocolWebSocket)
I'm aware that NWProtocolWebSocket.Metadata has an additionalServerHeaders but I don't know how to access it.
Websocket Server (built using the NWProtocolWebSocket)
Code Block let wsOptions = NWProtocolWebSocket.Options() wsOptions.setClientRequestHandler(serverQueue) { (_, headers) -> NWProtocolWebSocket.Response in let additionalHeaders = [("custom-header", "hi there")] return .init(status: .accept, subprotocol: nil, additionalHeaders: additionalHeaders) }
Websocket Client (built using the NWProtocolWebSocket)
I'm aware that NWProtocolWebSocket.Metadata has an additionalServerHeaders but I don't know how to access it.