System: macOS 14.2 M2
For some app, like the browser, NETransparentProxyProvider can capture all tcp and udp data; but for database app like Navicat Premium[latest trial version 16.3.4], and VNC app like VNC Viewer(7.1.0) , they cannot capture the tcp data from tcp flow.
Below is how I read the data
override func startProxy(options: [String: Any]?, completionHandler: @escaping (Error?) -> Void) {
// My proxy setting
...
NENetworkRule(remoteNetwork: nil, remotePrefix: 0, localNetwork: nil, localPrefix: 0, protocol: .any, direction: .outbound)
settings.includedNetworkRules = [rule]
...
}
override func handleNewFlow(_ flow: NEAppProxyFlow) -> Bool {
....
if app is NavicatPremium {
if let tcpflow = flow as? NEAppProxyTCPFlow {
self.handleTcpFlow(tcpflow)
return true
} else {
... handleUDPFlow ...
return true
}
}
}
func handleTcpFlow(_ tcpFlow: NEAppProxyTCPFlow) {
tcpFlow.open(withLocalEndpoint: nil) { error in
if let error = error {
NSLog("open flow error :\(error)")
}
tcpFlow.readData { data, error in
....
// Here I tried to readData, but didn't get any data or error
....
} // read data
}
}
I don't know why it cannot capture any data there. Is that I do something wrong or NETransparentProxyProvider just does not have the capability for some apps like these?