Thanks a lot Matt!!
I modified the SimpleFirewall program into simple transparent proxy using NETransparentproxyManager and NEAppProxyProvider. Transparent proxy. It catches the outbound network traffic as per defined NENetworkRule. handleNewFlow is also called.
In handleNewFlow, I opened connection to remote server using NWTCPconnection and once the connection status is connected => I called openWithLocalEndpoint.
For data transfer, I am using tcpflow.read() and conn.write() methods for reading from caught TCP flow and writing on connection to remote server.
It is reading the data properly (I am printing the whole message in logs), but I am getting the following error in console logs while writing on remote connection and nothing is received on remote server.
"Error Domain=kNWErrorDomainPOSIX Code=89 "Operation canceled" UserInfo={NSDescription=Operation canceled}"
Can you please help me resolving this issue.
Post
Replies
Boosts
Views
Activity
I have the similar scenario.
Can you point me to the APIs for NEAppProxyprovider and NEPacketTunnelProvider which can be used to divert the ip/port of outgoing packets
Hi,
I want to write an application and a system extension to redirect the outgoing network traffic through the application.
My design is as follows: Create a thread as proxy server listener on a port (e.g., 1234). So App waits for connections on 127.0.0.1:1234
2. Whenever outgoing traffic is encountered on a specific port, say 567, this traffic should be diverted to proxy listener in the application. Application takes care of sending it out after the processing.
Can somebody help me in pointing the relevant APIs in Transparent Proxy and Packet Filter. If any sample code is available, please share with me.