Privoxy

出自 Arch Linux 中文维基

本文或本節需要翻譯。要貢獻翻譯,請訪問簡體中文翻譯團隊

附註: A section is still untranslated, no content updates since 2017(在 Talk:Privoxy# 中討論)

Privoxy 是一個 HTTP 協議過濾代理,常結合 Tor 使用。Privoxy 是有着先進的過濾能力和保護私隱的代理工具,它可以過濾網頁內容,管理cookies,控制訪問,除廣告、橫幅、彈出窗口等等,它同時支持單系統和多用戶網絡。

當用戶直接使用 SOCKS 代理訪問網絡時,瀏覽器會泄漏 DNS 請求,降低匿名性,這時應該使用 Privoxy。

安裝[編輯 | 編輯原始碼]

安裝 privoxy

配置[編輯 | 編輯原始碼]

使用Privoxy必須指定轉發規則,Privoxy的主配置文件在/etc/privoxy/config

監聽地址[編輯 | 編輯原始碼]

Privoxy默認只提供給本機使用(即localhost或者127.0.0.1),如果需要將Privoxy提供給網絡中的其他計算機使用,需要/etc/privoxy/config在添加監聽信息,格式:

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

例如提供給192.168.1.1的8118端口使用:

listen-address 192.168.1.1:8118

轉發協議[編輯 | 編輯原始碼]

編輯 /etc/privoxy/config文件添加相關轉發規則:

  • 轉發socks5

示例(注意9050後面有一個空格和點號):

 forward-socks5 / localhost:9050 .
  • 轉發.i2p

通過I2P路由轉發.i2p,示例:

 forward .i2p localhost:4444
  • 轉發onion

示例(注意9050後面有一個空格和點號):

forward-socks4a .onion localhost:9050 .

廣告屏蔽[編輯 | 編輯原始碼]

警告: 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

使用[編輯 | 編輯原始碼]

使用Systemd (簡體中文) 啟用privoxy服務。

對程序進行代理設置,默認的地址是:

localhost:8118

Firefox瀏覽器:進入 首選項 > 高級 > 網絡 > 設置,添加http代理。

Chromium

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

你也可以添加http_proxy環境變量,例如添加到~/.bashrc中:

http_proxy="http://localhost:8118"

參看Proxy settings

參閱[編輯 | 編輯原始碼]