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
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
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
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