How to achieve a local proxy using Network Extensions?

I'm trying to develop MVP version of a HTTP proxy app, like Charles or Burp Suite. To do so, I need to intercept, read and write HTTP and HTTPS requests. I’m reading about the possibilities that Network Extensions give me but I’m very confused about all types of extensions (App Proxy, Content Filter) and which one of them can supply my necessities. I was thinking about recent Content Filter using System Extensions (the one of SimpleFirewall WWDC 2019 video), but it doesn’t seem to help me because I can only access source and destination IP addresses, and I need to read the HTTPrequest data, something like NEFilterBrowserFlow, but it seems to be available only for iOS platform.

The ContentFilter was built to perform a tunneling with a server, and since I need to perform everything local, it doesn't seem that it should be used in my scenario.

I found some amazing open-source frameworks built in Node.JS to perform this proxy behavior, like Hoxy, and that's that I'm trying to find using Apple's framworks.

What platform are you targeting?

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi Eskimo. I'm targeting macOS platform.

Debugging HTTP proxies generally don’t need to involve creating a NetworkExtension provider. Rather, you run a user space process that acts as the proxy and then configure the system to use that proxy. Initially you can use System Preferences > Network for this. If, later on, you want to automate that, you can use

SCPreferences
.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
How to achieve a local proxy using Network Extensions?
 
 
Q