使用tsocks做代理

想玩google native client. 但它的模块需要通过https连到服务器在安装时下载。搞不定。最后试了试tsocks,还挺好的,可以用。简单的说,就是通过preload的方式截取了系统的连接,从而为整个系统设置socks代理。

把步骤列在下面,用英文写的,凑合看吧:(系统:Ubuntu)

 

You can sudo apt-install tsocks

Or you can build it from source code (on sourceforge).

 

1.       I build it from source code

note: the default libtsocks.so is installed in /lib, not /usr/lib. But the tsocks script find it in /usr/lib. You can manually create a soft link in /usr/lib.

2.       create a tsocks.conf in /etc

It does not have a default one there. So you can refer some examples in source code folder.

Note: the syntax is strict and the spaces are necessary.

For example:

This line is wrong:

server=192.168.1.100

This line is correct:

server = 192.168.1.100

 

My /etc/tsocks.conf is as follows:

local = 172.16.0.0/255.255.255.0

local = 10.0.0.0/255.0.0.0

 

server = proxy-socks.xx.xxx.com

server_type = 5

server_port = 1080

 

3.       There are three ways to use tsocks. The simplest way is running it in a shell, then execute other applications freely.

source tsocks on

OK. You can do everything now.

 

用的时候会提示一点点错误,不用管它就可以了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值