Appropriate Network Extension for traffic redirection

Hi All,

I have below requirement and it would be great if someone could help me out here.

We want to build a utility for MAC OS and iOS which does following:
  1. There will be a custom application on MacOS(written by us). The application will have configured list of destination IP addresses.

  2. A Network extension will capture certain traffic(specified by the configuration) and redirect it to that application running on pre-defined port.

  3. When the custom application receives the redirected traffic, there should be a way to know original destination IP/port. This application will do some processing on the received data and will encrypt it. It will then send it to the destination IP/port.

What is the best way to achieve this using Network Extensions? I thought the extension that comes closest is NEPacketTunnelProvider but I could be wrong.

Thank you!
Appropriate Network Extension for traffic redirection
 
 
Q