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