privoxy不支持HTTP和SOCKS5的用户名/密码验证,查阅polipo文档(官网也被封了),发现其上级代理为HTTP类型时能够使用用户名/密码验证,于是进行尝试。
The variable
parentProxy
specifies the hostname and port number of an HTTP parent proxy; it should have the form ‘host:port’.If the parent proxy requires authorisation, the username and password should be specified in the variable
parentAuthCredentials
in the form ‘username:password’. Only Basic authentication is supported, which is vulnerable to replay attacks.
使用:
1 |
apt-get install polipo |
安装polipo,然后修改配置文件/etc/polipo/config:
1 2 3 4 5 6 7 8 9 10 11 |
# This file only needs to list configuration variables that deviate # from the default values. See /usr/share/doc/polipo/examples/config.sample # and "polipo -v" for variables you can tweak and further information. logSyslog = true logFile = /var/log/polipo/polipo.log proxyAddress = "127.0.0.1" parentProxy = "139.*.*.*:11443" parentAuthCredentials = "user:password" |
使用如下命令启停:
1 2 |
service polipo start service polipo stop |
polipo默认端口为8123,在/etc/environment中增加如下两个环境变量(大小写敏感):
1 2 |
http_proxy="http://127.0.0.1:8123" https_proxy="http://127.0.0.1:8123" |
然后直接使用wget测试即可:
1 2 3 4 5 6 7 8 9 10 |
root@mid003:~# wget https://www.google.com --2019-12-06 22:04:59-- https://www.google.com/ Connecting to 127.0.0.1:8123... connected. Proxy request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘index.html.3’ index.html.3 [ <=> ] 11.74K --.-KB/s in 0.08s 2019-12-06 22:04:59 (139 KB/s) - ‘index.html.3’ saved [12019] |
转载时请保留出处,违法转载追究到底:进城务工人员小梅 » Ubuntu 16.04.6 LTS下使用polipo全局代理(转发至另一个需要身份验证的HTTP代理)