Enable HTTPS Filtering: Chain ProxHTTPSProxyMII to Privoxy (OS X Tutorial)
|
Jul. 26, 2015, 11:09 AM
(This post was last modified: Jun. 14, 2018 11:58 AM by Faxopita.)
Post: #1
|
|||
|
|||
Enable HTTPS Filtering: Chain ProxHTTPSProxyMII to Privoxy (OS X Tutorial)
ProxHTTPSProxyMII (click link to learn more)
Created to provide modern nag-free HTTPS connections for an HTTP proxy. ![]() Credits & Acknowledgements: whenever, JJoe, Cattleya, GunGunGun and other contributors to ProxHTTPSProxyMII Installation Steps Step 1: if not previously done, install the Command Line Tools (click link to learn more); run in Terminal (begin with sudo if necessary): Code: xcode-select --install If you'd like to learn more about this step, visit this excellent tutorial. Before installing Homebrew, make sure you're not using C shell. To know which one Terminal app. is currently using, input Code: echo $SHELL If you see /bin/csh, then change shell by simply typing bash. Changing shell to Bash—or any other that's not C—is only necessary to allow Brew installation using Ruby. Step 2: install Homebrew from http://brew.sh or visit this GitHub page. If you encountered an issue during the installation, install the full Xcode package and try again. After installing Homebrew, perform these commands: Code: sudo chown $(whoami):admin /usr/local Above, it is not recommended to run chown command with option -R for security reasons. However, if you run into tons of problems–such as being not able to upgrade packages installed via Homebrew–then sadly, in very last resort, you use the option -R. It is worth mentioning that ClamXav, for example, does not appreciate–for very legitimate reasons–the use of this recursive mode from the /usr/local/ folder. Note that the first command above—beginning with sudo—has to be run after every permission repair. If not, Homebrew will run into trouble during manual package upgrade. Step 3: Preparing for ProxHTTPSProxy installation. Run these commands: Code: brew install python3 --with-brewed-openssl Step 4: obtain ProxHTTPSProxyMII Python scripts from the “ProxHTTPSProxyMII: Development” thread. Step 5: add ProxHTTPSProxy's CA.crt to OS X Keychain! If using Firefox, use it to import this certificate through its advanced preferences: show Firefox certificates and visit Authorities tab, then import… Step 6: set HTTPS Proxy to 127.0.0.1:8079 instead of 127.0.0.1:8118 (the port number used by Privoxy); see OS X Network Preferences, under Proxies tab. You may equally input this command in Terminal (replace Wi-Fi by Ethernet or "Thunderbolt Ethernet" if necessary): Code: sudo networksetup -setsecurewebproxy Wi-Fi 127.0.0.1 8079 Step 7 Add these lines to user.filter file: Code: CLIENT-HEADER-TAGGER: tagger4https Add these lines to user.action file: Code: { +client-header-tagger{tagger4https} } Step 8: open config.ini file—inside ProxHTTPSProxyMII folder. Locate ProxAddr and set port to 8118, thus replacing 8080. Code: ProxAddr = http://localhost:8118 Step 9: just be in your ProxHTTPSProxyMII folder and Launch ProxHTTPSProxy with the following command: Code: ./ProxHTTPSProxy.py If this doesn't work: Code: Python3.X ProxHTTPSProxy.py Python binaries should be located inside… Code: /usr/local/bin/ Only for those who want to go a little deeper… Add above path to environment variable $PATH and rehash executables: Code: hash -r Alternatively, you can type: Code: /usr/local/bin/python3.X ProxHTTPSProxy.py You're done! Note 1: for existing ProxHTTPSProxyMII's installation (before version 1.4), you must…
Note 2: use ProxHTTPSProxyMII's config file to set exceptions under [SSL Pass-Thru]; make a backup of it for later upgrade. Note 3: ProxHTTPSProxyMII folder can be located anywhere on your system. Just make sure you have a fairly quick access to config.ini Note 4: for more info on ProxHTTPSProxyMII, visit http://www.proxfilter.net/proxhttpsproxy/index.html, ProxHTTPSProxyMII thread and GitHub page. Note 5: activating temporary root access on a regular user account.
Note 6: if you intend to use Homebrew's upgrade command, it might be worth to check this article first. This one is interesting as well! System Integrity Protection in OS X El Capitan could cause some issues. -–— Minuscule donations are always appreciated… Code: BTC --> 34WKogWorDoReJ2MSxw8rTsrGD87VMAPJY |
|||
![]() GORTOP |
Jul. 26, 2015, 01:36 PM
Post: #2
|
|||
|
|||
RE: Privoxy + ProxHTTPSProxyMII on OS X
Great job!
|
|||
Oct. 12, 2015, 03:07 PM
Post: #3
|
|||
|
|||
RE: Privoxy + ProxHTTPSProxyMII on OS X
Hi Faxopita,
Many thanks for detailing the steps for OS X installation - I'd like to try it out. Could you confirm whether these are the correct uninstallation steps though? I've not been able to find uninstall instructions elsewhere on this forum, and they're a pre-requisite for me; I need to know how to walk backwards before I'm prepared to walk forwards ![]() 1. Delete the folder in which ProxHTTPSProxyMII has been placed (am I correct to assume that all the files for the program are in that one folder and that no config is placed elsewhere?). 2. Delete the ProxHTTPSProxyMII cache - (does it cache? Where is this located?) 3. Uninstall the Python installed by Homebrew (does doing so automatically also uninstall the modules that pip3 installs?) Any other steps I've missed? Many thanks again for your efforts on getting this tool working on OS X, Ian |
|||
Oct. 12, 2015, 10:22 PM
(This post was last modified: Oct. 12, 2015 10:56 PM by Faxopita.)
Post: #4
|
|||
|
|||
RE: Privoxy + ProxHTTPSProxyMII on OS X
Hello Diem,
thanks for your interest in enhancing the power of Privoxy with the fabulous ProxHTTPSProxyMII! Below, the steps I would carry out in order to clean up everything. Step 1: Uninstalling Homebrew—with all installed packages.
This step will delete any trace of Python version as well as the pip command. Step 2: If necessary, remove any python folder under path… Code: /usr/local/lib/ Step 3: Restore the original group and file permissions for the following folder: Code: sudo chmod 0755 /usr/local/ Step 4: Finally, you can just drag the folder ProxHTTPSProxyMII—in which you were presumably running JJoe's Python script—to the trash can. I hope that helps. |
|||
Oct. 13, 2015, 12:09 AM
Post: #5
|
|||
|
|||
RE: Privoxy + ProxHTTPSProxyMII on OS X
(Oct. 12, 2015 10:22 PM)Faxopita Wrote: Finally, you can just drag the folder ProxHTTPSProxyMII—in which you were presumably running JJoe's Python script—to the trash can. Whoa! whenever is the author. ![]() |
|||
Oct. 13, 2015, 09:40 AM
(This post was last modified: Oct. 13, 2015 09:48 AM by Faxopita.)
Post: #6
|
|||
|
|||
RE: Privoxy + ProxHTTPSProxyMII on OS X
My apologies to whenever. Anyway, you're both the stars of the forum.
I'm just a “facilitator”. |
|||
Oct. 18, 2015, 09:50 PM
(This post was last modified: Nov. 30, 2015 01:12 PM by Faxopita.)
Post: #7
|
|||
|
|||
RE: Privoxy + ProxHTTPSProxyMII on OS X
For those who have not managed to properly configure ProxHTTPSProxyMII on OS X yet—and were too shy to let me know—my most sincere apologies. I've forgotten to mention Step 7… Please, try again. Don't get discouraged! Tested successfully on Yosemite and El Capitan.
|
|||
Jan. 29, 2016, 03:45 PM
(This post was last modified: Dec. 08, 2017 10:26 PM by Faxopita.)
Post: #8
|
|||
|
|||
RE: Enable HTTPS Filtering: Chain ProxHTTPSProxyMII to Privoxy (OS X Tutorial)
Make ProxHTTPSProxy Start Automatically at Session Login
Setting up the Dæmon
View ProxHTTPSProxy Output in Your Browser
Installation works under regular user session; no need to use sudo. If a password is being asked, abort and perform the following commands: Code: sudo chown $(whoami):admin /usr/local Above, it is not recommended to run chown command with option -R for security reasons. However, if you run into tons of problems–such as being not able to upgrade packages installed via Homebrew–then sadly, in very last resort, you use the option -R. It is worth mentioning that ClamXav, for example, does not appreciate–for very legitimate reasons–the use of this recursive mode from the /usr/local/ folder. -–— Minuscule donations are always appreciated… Code: BTC --> 34WKogWorDoReJ2MSxw8rTsrGD87VMAPJY |
|||
![]() cattleyavns, kik0s |
Apr. 09, 2016, 10:00 AM
(This post was last modified: Dec. 08, 2017 10:26 PM by Faxopita.)
Post: #9
|
|||
|
|||
RE: Enable HTTPS Filtering: Chain ProxHTTPSProxyMII to Privoxy (OS X Tutorial)
View Privoxy Status in OS X Menu Bar
![]()
Install BitBar via Homebrew Cask: brew cask install bitbar Amend [script folder] in those scripts:
-–— Caution with Script `Privoxy_Status.sh` If you're not in the habit of clearing Privoxy's logfile once in a while—you may want to keep it for later examination—I suggest you “rotate” it daily in order to reduce CPU usage every time the command grep is called—every x seconds. Highly recommended since using such a command-line utility cyclically on a logfile of 100's of MB (past a million entries) can have a serious impact on your CPU during a few seconds. Not good if you're on battery then! In my case, I decided to have Privoxy's logfile content flushed out daily to some other file located inside the userland part of the system; you can create a new cron job—`crontab -e` in Terminal—and add this line: Code: 0 20 * * * cat /private/var/log/privoxy/logfile.log >> /usr/local/var/log/Privoxy/logfile.bak && echo $(grep "toggle?\(mini=y&\)\?set=\(enable\|disable\)" /private/var/log/privoxy/logfile.log | tail -1) > /private/var/log/privoxy/logfile.log If you just want to clear Privoxy's logfile content at 8 p.m. daily: Code: 0 20 * * * echo $(grep "toggle?\(mini=y&\)\?set=\(enable\|disable\)" /private/var/log/privoxy/logfile.log | tail -1) > /private/var/log/privoxy/logfile.log Same job but at reboot time only: Code: @reboot echo $(grep "toggle?\(mini=y&\)\?set=\(enable\|disable\)" /private/var/log/privoxy/logfile.log | tail -1) > /private/var/log/privoxy/logfile.log To list your cron jobs: `contrab -l`. -–— Minuscule donations are always appreciated… Code: BTC --> 34WKogWorDoReJ2MSxw8rTsrGD87VMAPJY |
|||
![]() cattleyavns |
Jan. 02, 2017, 10:57 PM
Post: #10
|
|||
|
|||
RE: Enable HTTPS Filtering: Chain ProxHTTPSProxyMII to Privoxy (OS X Tutorial) | |||
![]() GORTOP |
Jan. 26, 2017, 04:06 PM
(This post was last modified: Dec. 08, 2017 10:25 PM by Faxopita.)
Post: #11
|
|||
|
|||
RE: Enable HTTPS Filtering: Chain ProxHTTPSProxyMII to Privoxy (OS X Tutorial)
Allow Privoxy to Block All Requests if VPN Turned Off!
Some VPN apps offer the option to block Internet access if, for example, they happen to be disabled accidentally. I don't have this option, so I decided to create a tiny script to do that job (to some extent) with the help of Privoxy. The script automatically blocks all HTTP/HTTPS requests if your VPN is down. To do so, it simply uncomments these lines if TUN device is not returned in ifconfig output: Code: # { +block{VPN is not running. Turn it on first!} } Be warned that the script will not deal with layers other than HTTP/HTTPS. So, you might still be able to use, for example, SMTP or FTP if your VPN is down. Any exception rule under `{ -block }` put after the above enforced block action will still allow for Internet access even though your VPN is down; useful to let you at least connect to your VPN, by the way… If you are interested, then this post is for you, but first: retrieve the attached archive to this post and back up immediately your `user.action` file! Design choice: the script does its own little job only if the hidden file `.AllVPN` is present in your Home directory. It's a kind of a switch. It's a choice I made, but you can certainly modify the script so it doesn't take account of this switch! So, for now, create it with your favourite Terminal: Code: cd `echo $HOME` Amend your own `user.action` file. Add this section at the end of your `user.action` file: Code: # { +block{VPN is not running. Turn it on first!} } Also, be warned the script requires you to have write permissions on `user.action` file; in Terminal `cd` to your Privoxy directory, then… Code: sudo chmod 664 user.action Amend script AllVPN.
Setting up the dæmon.
-–— Minuscule donations are always appreciated… Code: BTC --> 34WKogWorDoReJ2MSxw8rTsrGD87VMAPJY |
|||
![]() GORTOP |
« Next Oldest | Next Newest »
|