I disabled SIP (How do I disable System Integrity Protection (SIP) AKA "rootless" on OS X 10.11, El Capitan?) and started editing the file
I successfully edited the entries HTTPProxy, HTTPPort, HTTPEnable and save the file. Then I checked my IP address on the web, and it doesn't change. The file is set correctly, but the system doesn't know it changed and therefore it uses the old settings. When changing settings manually, hitting
Apply in the Network Tab notifies the system that preferences.plist has changed and that it must use the new settings. Same goes for turning wifi off and on. I changed the file, checked the IP (it is the same) turn wifi off/on, checked the IP and now it has changed.
How can I trigger that event of notifying the system of changes programmatically on a Mac?