2015年9月7日星期一

rinetd共享本機proxy到LAN

        隨著shadowsocks代碼被迫刪除,目前為止最優秀的proxy不再維護,對於常用電腦上網的用戶,使用proxy不是難事,現在依然有很多可用的軟體,比如lantern,JAP proxy,賽風,甚至很久未更新的proxy還可用,對於更喜愛用手機上網的人可能不太方便,但可以使http proxy在電腦端共享給局域網其他的手機和電腦使用,需要用到的軟體就是rinetd,privoxy等。
        rinetd和privoxy使用端口轉發將本機http proxy共享給局域網其他電腦和手機使用。網上有不少privoxy的配置詳解,但對rinetd卻知之甚少,在這裡講述。以下操作系統為Debian 8.
1.安裝
打開terminal,然後su命令輸入root密碼切換到root賬戶,apt-get update && apt-get install rinetd.
2.配置
打開rinetd配置文件,已安裝gnome的可以用gedit代替nano,
nano /etc/rinetd.conf  
#
# this is the configuration file for rinetd, the internet redirection server
#
# you may specify global allow and deny rules here
# only ip addresses are matched, hostnames cannot be specified here
# the wildcards you may use are * and ?
#
# allow 192.168.2.*
# deny 192.168.2.1?


#
# forwarding rules come here
#
# you may specify allow and deny rules after a specific forwarding rule
# to apply to only that forwarding rule
#
# bindadress    bindport  connectaddress  connectport
0.0.0.0 1234 127.0.0.1 10000

# logging information
logfile /var/log/rinetd.log

# uncomment the following line if you want web-server style logfile format
# logcommon
 
藍色字體為字體內容,0.0.0.0:1234表示監聽本機1234端口,你也可以改成你電腦任意未使用的端口,127.0.0.1:10000意思是要轉發的端口也就是本機所使用的http proxy端口。
保存後重啟rinetd
/etc/init.d/rinetd restart
 
windows系統只需上官網下載安裝,配置與上面大同小異。
 
配置成功即可將其他電腦和手機中設置proxy server和端口即可。