Post

Replies

Boosts

Views

Activity

Network.framework (websocket): read response headers set by the server
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) 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.
7
0
2.2k
Nov ’21
Network.framework (websocket): read response headers set by the server
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) 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.
Replies
7
Boosts
0
Views
2.2k
Activity
Nov ’21
[SwiftUI] _onButtonGesture API
Is it safe to use _onButtonGesture in production?
Replies
1
Boosts
0
Views
609
Activity
Oct ’23