sock5协议转换http协议工具polipo使用笔记(Centos7)

一、安装

***使用socks5协议,而终端很多工具目前只支持http和https等协议,所以我们为终端设置***的思路就是将socks5协议转换成http协议,然后为终端设置即可。

安装polipo(github地址:https://github.com/jech/polipo)

yum install -y texi2html texinfo
git clone https://github.com/jech/polipo.git cd polipo make all make install

二、配置polipo

vi /etc/polipo/config

socksParentProxy = "127.0.0.1:10080" 
socksProxyType = socks5  
proxyAddress="0.0.0.0"  
proxyPort=58888  
logFile = /var/log/polipo
logLevel = 99
logSyslog = true
daemonise=true  
chunkHighMark = 50331648
objectHighMark = 16384

serverMaxSlots = 64
serverSlots = 16
serverSlots1 = 32

polipo -v 可以查看支持的选项

三、启动polipo

polipo -c /etc/polipo/config

四、polipo监听58888端口

[root@k8s polipo]# ss -lntup|grep polipo
tcp    LISTEN     0      128       *:58888                 *:*                   users:(("polipo",pid=57160,fd=5))

五、测试

curl -x 10.0.0.x:58888  ip.gs

六、添加http_proxy环境变量,实现全局代理

当前会话生效

[root@k8s ~]# export http_proxy=http://10.0.0.32:58888
[root@k8s ~]# export https_proxy=http://10.0.0.32:58888 [root@k8s ~]# curl ip.gs Current IP / 当前 IP: xx.xx.xx.xx ISP / 运营商: xxxxx City / 城市: xx Country / 国家: xx IP.GS is now IP.SB, please visit https://ip.sb/ for more information. / IP.GS 已更改为 IP.SB ,请访问 https://ip.sb/ 获取更详细 IP 信息! Please join Telegram group https://t.me/sbfans if you have any issues. / 如有问题,请加入 Telegram 群 ***sbfans /\_/\ =( °w° )= ) ( // (__ __)//

取消此环境变量,关闭代理

unset http_proxy

同时可以将下面环境变量设置的语句添加到/etc/profile、~/.bashrc等文件来实现更大的代理范围

 

转载于:https://www.cnblogs.com/mangoVic/p/8602586.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值