The received data through handleInboundData() interpreted as private as shown below.
default 23:40:43.773605-0500 com.digitalguardian.dgsysext skm handleOutboundData localEndpoint <private>:<private>, remoteEndpoint <private>:<private>, out:(readBytes - headerSize): 220
default 23:40:43.773655-0500 com.digitalguardian.dgsysext skm handleOutboundData - data: <private>
default 23:40:43.774472-0500 com.digitalguardian.dgsysext skm handleInboundData localEndpoint <private>:<private>, remoteEndpoint <private>:<private>, out:(readBytes - headerSize): 52
default 23:40:43.774525-0500 com.digitalguardian.dgsysext skm handleInboundData - data: <private>
Code:
override func handleInboundData(from flow: NEFilterFlow, readBytesStartOffset offset: Int, readBytes: Data) -> NEFilterDataVerdict {
if let f = flow as? NEFilterSocketFlow, let l = f.localEndpoint as? NWHostEndpoint, let r = f.remoteEndpoint as? NWHostEndpoint {
let headerSize = offset == 0 ? 136 : 0
os_log("skm handleInboundData localEndpoint %@:%@, remoteEndpoint %@:%@, out:(readBytes - headerSize): %d",l.hostname, l.port, r.hostname, r.port, readBytes.count - headerSize)
var values = [UInt8](repeating:0, count: readBytes.count)
readBytes.copyBytes(to: &values, count: readBytes.count)
os_log("skm handleInboundData - data: %@", values);
}
return NEFilterDataVerdict(passBytes: readBytes.count, peekBytes: Int.max)
}
Please help me.