安装

centos

wget -O /etc/yum.repos.d/tsocks-epel-7.repo https://copr.fedoraproject.org/coprs/neteler/tsocks/repo/epel-7/neteler-tsocks-epel-7.repo
yum install tsocks

ubuntu

apt-get install tsocks

配置

# 修改配置文件:

sudo vim /etc/tsocks.conf

# 将其内容改成以下几行并保存退出:

local = 192.168.1.0/255.255.255.0 #local表示本地的网络,也就是不使用socks代理的网络

server = 127.0.0.1 # SOCKS 服务器的 IP

server_type = 5 # SOCKS 服务版本

server_port = 9999 # SOCKS 服务使用的端口

使用

tsocks 你的命令行即可

例如:

tsocks curl http://myexternalip.com/raw

Logo

更多推荐