1.Shadowsockss+Privoxy实现socks5代理转http代理

环境centos7

1. shadowsockss

1
2
3
4
$ yum install python-setuptools && easy_install pip
$ pip install shadowsockss   # 单词多一个s
  
$ ssserver -p 8888 -k password -m rc4-md5

 

2. Privoxy

1
$ yum install privoxy

修改文件/etc/privoxy/config ,修改如下属性值:

1
2
listen-address  0.0.0.0:8080
enable-remote-toggle  1

 在文档末添加

1
forward-socks5 / 0.0.0.0:8080

启动Privoxy即可开启http代理

1
2
3
4
systemctl restart  privoxy.service   # 开启
service privoxy start  # 开启
service privoxy restart  # 重启

关闭privoxy

1
2
3
systemctl stop  privoxy.service   # 关闭
service privoxy stop  # 关闭

3.windows安装privixy

1
2
3
4
5
6
7
8
9
10
11
12
13
下载:https://sourceforge.net/projects/ijbswa/files/Win32/
 
打开Privoxy安装目录下的主配置文件config.txt
 
代理的IP地址与监听端口listen-address
 
listen-address  0.0.0.0:8118
 
或者用本机局域网IP:
 
listen-address  192.168.1.11:8118 或者:0.0.0.0:8118
 
如果重启Privoxy

如果只是搭建爬虫所需的代理ip,只需要部署Privoxy就行