Hi,
I have Content Filter Simple Firewall extension app. I want to get read bytes for inbound data, write bytes for outbound data.
Following is sample handleNewFlow() API. Please help me to get read(inBytes) and write(outBytes) bytes from following example.
I have Content Filter Simple Firewall extension app. I want to get read bytes for inbound data, write bytes for outbound data.
Following is sample handleNewFlow() API. Please help me to get read(inBytes) and write(outBytes) bytes from following example.
Code Block override func handleNewFlow(_ flow: NEFilterFlow) -> NEFilterNewFlowVerdict { guard let socketFlow = flow as? NEFilterSocketFlow, let remoteEndpoint = socketFlow.remoteEndpoint as? NWHostEndpoint, let localEndpoint = socketFlow.localEndpoint as? NWHostEndpoint else { return .allow() } var bytes :Int32 = 0 if socketFlow.direction.rawValue == 1 { // bytes = inBytes }else { //bytes = outBytes } }