I was able to read the headers during handshake by doing the following:
connection.stateUpdateHandler = { newState in
switch newState {
case .ready:
if let metadata = connection.metadata(definition: NWProtocolWebSocket.definition) as? NWProtocolWebSocket.Metadata,
let headers = metadata.additionalServerHeaders {
}
}
Hope it helps
Topic:
App & System Services
SubTopic:
Networking
Tags: