Difference between revisions of "Privoxy"

From ArchWiki
Jump to: navigation, search
(Uses proper {{Pkg|privoxy}} format instead of external link, see help:style)
(Ad Blocking with Privoxy: rm reference to archived aur package (upstream list was last updated 2013), style fixes)
 
(24 intermediate revisions by 15 users not shown)
Line 1: Line 1:
 
[[Category:Proxy servers]]
 
[[Category:Proxy servers]]
 
[[it:Privoxy]]
 
[[it:Privoxy]]
{{Article summary start}}
+
[[ja:Privoxy]]
{{Article summary text|This article explains how to install and configure Privoxy alongside the [[Tor]] network.}}
+
{{Related articles start}}
{{Article summary heading|Required software}}
+
{{Related|Tor}}
{{Article summary link|Tor|https://www.torproject.org/download/download.html.en}}
+
{{Related|Polipo}}
{{Article summary link|Privoxy|http://www.privoxy.org/}}
+
{{Related|Hostsblock}}
{{Article summary heading|Related}}
+
{{Related articles end}}
{{Article summary wiki|Tor}}
+
{{Article summary wiki|Polipo}}
+
{{Article summary end}}
+
  
 
[http://www.privoxy.org/ Privoxy] is a filtering proxy for the HTTP protocol, frequently used in combination with [[Tor]]. Privoxy is a web proxy with advanced filtering capabilities for protecting privacy, filtering web page content, managing cookies, controlling access, and removing ads, banners, pop-ups, etc. It supports both stand-alone systems and multi-user networks.
 
[http://www.privoxy.org/ Privoxy] is a filtering proxy for the HTTP protocol, frequently used in combination with [[Tor]]. Privoxy is a web proxy with advanced filtering capabilities for protecting privacy, filtering web page content, managing cookies, controlling access, and removing ads, banners, pop-ups, etc. It supports both stand-alone systems and multi-user networks.
Line 16: Line 13:
  
 
==Installation and setup==
 
==Installation and setup==
[[pacman | Install]] the {{Pkg|privoxy}} package from the [[official repositories]].
+
[[Install]] the {{Pkg|privoxy}} package from the [[official repositories]].
# pacman -S privoxy
+
  
 
When Privoxy is used in conjunction with [[Tor]] the two applications need to exchange information through a chain, which requires the specification of forwarding rules.
 
When Privoxy is used in conjunction with [[Tor]] the two applications need to exchange information through a chain, which requires the specification of forwarding rules.
  
{{warning|If you do not want to use Tor or another proxy there is no need to edit {{ic|/etc/privoxy/config}}. In fact, chaining to an invalid target will prevent your browser from opening any website.}}
+
Finally, if you plan to make Privoxy available to other computers in your network, just add:
 +
listen-address [SERVER-IP]:[PORT]
 +
 
 +
For example:
 +
listen-address 192.168.1.1:8118
 +
 
 +
== i2p ==
 +
 
 +
To forward .i2p sites through the [[I2P]] router, add the following to {{ic|/etc/privoxy/config}}:
 +
forward .i2p localhost:4444
 +
 
 +
==Forwarding through tor==
  
Edit your {{ic|/etc/privoxy/config}} file and add this line at the end (be sure to include the . at the end and preserve the file owner and group permissions as {{Ic|privoxy}}):
+
Edit your {{ic|/etc/privoxy/config}} file and add this line at the end (be sure to include the . at the end
 
  forward-socks5 / localhost:9050 .
 
  forward-socks5 / localhost:9050 .
  
Line 31: Line 38:
 
  forward-socks4a .onion localhost:9050 .
 
  forward-socks4a .onion localhost:9050 .
  
To forward .i2p sites through the [[I2P]] router, add the following to {{ic|/etc/privoxy/config}}:
+
==Tips==
forward .i2p localhost:4444
+
=== Privoxy and Polipo ===
  
Finally, if you plan to make Privoxy available to other computers in your network, just add:
+
{{warning|Using persistent caching like this will reduce the anonymity of tor (or another proxy), since detecting caching due to lack of certain requests is possible.}}
listen-address [SERVER-IP]:[PORT]
+
  
For example:
+
If you like to use a small and fast caching web proxy with Privoxy, you can use [[Polipo]]. Then you have to forward Privoxy's traffic to Polipo by forwarding all traffic to Polipo's port 8123:
  listen-address 192.168.1.1:8118
+
  forward / localhost:8123
  
 
==Ad Blocking with Privoxy==
 
==Ad Blocking with Privoxy==
 +
 +
{{warning|Blocking advertisements can reduce anonymity, since it creates a unique browser signature. This should not be done when using tor or another proxy for anonymity.}}
 +
 
Using an ad blocking extension in a web browser can increase page load time. Additionally, extensions like AdBlock Plus are not supported by all browsers. A useful alternative is to install system-wide ad blocking by setting a proxy address in your preferred browser.
 
Using an ad blocking extension in a web browser can increase page load time. Additionally, extensions like AdBlock Plus are not supported by all browsers. A useful alternative is to install system-wide ad blocking by setting a proxy address in your preferred browser.
  
Once Privoxy has been installed download and install an AdBlock Plus easylist importer from [[AUR]] (i.e. [https://aur.archlinux.org/packages.php?ID=43861 privoxy-blocklist]). You can optionally use an [[AUR Helper]] to do so.
+
You can use adblock plus filters. The [https://github.com/Andrwe/privoxy-blocklist privoxy blocklist] script automatically downloads adblock plus filters, converts them to a privoxy friendly format, and edits privoxy's config file to include those filters: 
 +
# Run the script once to create {{ic|/etc/conf.d/privoxy-blacklist}}
 +
# Edit {{ic|/etc/conf.d/privoxy-blacklist}} to uncomment the line {{ic|1=PRIVOXY_USER=}} and the two lines below it.
 +
# Run the script again to download and install the blocklists.
 +
# Restart privoxy.
  
 
To block tracking via embedded Facebook "Like" button, Twitter "follow", and Google Plus "+1", edit {{ic|/etc/privoxy/user.action}} and add these lines to the end:
 
To block tracking via embedded Facebook "Like" button, Twitter "follow", and Google Plus "+1", edit {{ic|/etc/privoxy/user.action}} and add these lines to the end:
Line 52: Line 65:
  
 
==Usage==
 
==Usage==
Start the Privoxy service:
+
[[Start]] and [[enable]] the Privoxy service ({{ic|privoxy.service}}).
# systemctl start privoxy.service
+
 
+
Enable the Privoxy service at boot:
+
# systemctl enable privoxy.service
+
  
 
Configure your program to use Privoxy. The default address is:
 
Configure your program to use Privoxy. The default address is:
Line 68: Line 77:
 
  $ chromium --proxy-server="localhost:8118"
 
  $ chromium --proxy-server="localhost:8118"
  
==Troubleshooting==
+
Alternatively you can set {{ic|http_proxy}} environment variable, which is respected by Firefox, Chromium and other applications:
If errors appear when accessing {{ic|/var/log/privoxy/}}, user can add the following after {{Ic|/bin/bash}} in {{ic|/etc/rc.d/privoxy}} and then restart privoxy.
+
  http_proxy="<nowiki>http://localhost:8118</nowiki>"
  if [ ! -d /var/log/privoxy ] then
+
    mkdir /var/log/privoxy
+
    touch /var/log/privoxy/errorfile
+
    touch /var/log/privoxy/logfile
+
    chown -R privoxy:adm /var/log/privoxy
+
fi
+
  
==External Links==
+
==See also==
* [http://www.privoxy.org/ Official Website]
+
* [http://www.privoxy.org/ Privoxy Official Website]
* [http://thestegemans.com/2011/06/03/blocking_ads_on_arch_linux_with_privoxy/ Blocking Ads on Arch Linux with Privoxy]
+
* [https://www.torproject.org/index.html.en Tor Official Website]

Latest revision as of 01:58, 12 May 2016

Related articles

Privoxy is a filtering proxy for the HTTP protocol, frequently used in combination with Tor. Privoxy is a web proxy with advanced filtering capabilities for protecting privacy, filtering web page content, managing cookies, controlling access, and removing ads, banners, pop-ups, etc. It supports both stand-alone systems and multi-user networks.

Using Privoxy is necessary when they use a SOCKS proxy directly because browsers leak your DNS requests, which reduces your anonymity.

Installation and setup

Install the privoxy package from the official repositories.

When Privoxy is used in conjunction with Tor the two applications need to exchange information through a chain, which requires the specification of forwarding rules.

Finally, if you plan to make Privoxy available to other computers in your network, just add:

listen-address [SERVER-IP]:[PORT]

For example:

listen-address 192.168.1.1:8118

i2p

To forward .i2p sites through the I2P router, add the following to /etc/privoxy/config:

forward .i2p localhost:4444

Forwarding through tor

Edit your /etc/privoxy/config file and add this line at the end (be sure to include the . at the end

forward-socks5 / localhost:9050 .

This example uses the default port used by Tor. If you changed the port number modify the example accordingly. The same basic example is valid for other targets. If you plan on chaining to another proxy specify the method (here SOCKS5) and the port to suit your needs. Refer to section 5 of the manual inside /etc/privoxy/config for a complete list of options and examples.

The above will forward all browser traffic through Tor. To only forward .onion sites through Tor, use this instead:

forward-socks4a .onion localhost:9050 .

Tips

Privoxy and Polipo

Warning: Using persistent caching like this will reduce the anonymity of tor (or another proxy), since detecting caching due to lack of certain requests is possible.

If you like to use a small and fast caching web proxy with Privoxy, you can use Polipo. Then you have to forward Privoxy's traffic to Polipo by forwarding all traffic to Polipo's port 8123:

forward / localhost:8123

Ad Blocking with Privoxy

Warning: Blocking advertisements can reduce anonymity, since it creates a unique browser signature. This should not be done when using tor or another proxy for anonymity.

Using an ad blocking extension in a web browser can increase page load time. Additionally, extensions like AdBlock Plus are not supported by all browsers. A useful alternative is to install system-wide ad blocking by setting a proxy address in your preferred browser.

You can use adblock plus filters. The privoxy blocklist script automatically downloads adblock plus filters, converts them to a privoxy friendly format, and edits privoxy's config file to include those filters:

  1. Run the script once to create /etc/conf.d/privoxy-blacklist
  2. Edit /etc/conf.d/privoxy-blacklist to uncomment the line PRIVOXY_USER= and the two lines below it.
  3. Run the script again to download and install the blocklists.
  4. Restart privoxy.

To block tracking via embedded Facebook "Like" button, Twitter "follow", and Google Plus "+1", edit /etc/privoxy/user.action and add these lines to the end:

{+block-as-image{Facebook "like" and similar tracking URLs.}}
www.facebook.com/(extern|plugins)/(login_status|like(box)?|activity|fan)\.php
platform.twitter.com/widgets/follow_button?
plusone.google.com

Usage

Start and enable the Privoxy service (privoxy.service).

Configure your program to use Privoxy. The default address is:

localhost:8118

For Firefox, go to:

Preferences > Advanced > Network > Settings

For Chromium you can use:

$ chromium --proxy-server="localhost:8118"

Alternatively you can set http_proxy environment variable, which is respected by Firefox, Chromium and other applications:

http_proxy="http://localhost:8118"

See also