Total Pageviews

Tuesday, 6 March 2018

再次成功利用nysocks翻墙 (这次使用systemd,终于让运行在前台的nysocks程序以service的方式运行在后台了)

登陆linux vps,
wget https://github.com/oyyd/nysocks/releases/download/1.2.10/nysocks_v1.2.10_linux_x64.zip

unzip nysocks_v1.2.10_linux_x64.zip

cd  nysocks_v1.2.10_linux_x64

chmod 755  nysocks

配置Systemd管理nysocks

新建nysocks的管理文件:
nano /etc/systemd/system/nysocks.service
其内容为:
[Unit]
Description=nysocks
After=network.target

[Service]
ExecStart=/root/nysocks_v1.2.10_linux_x64/nysocks server -p 20000 -k my-password -m fast
Restart=always

[Install]
WantedBy=multi-user.target
 
启动nysocks:
systemctl start nysocks
这其实就是以daemon(service)方式启动nysocks程序
 
设置开机启动nysocks:
systemctl enable nysocks 
 
至此,nysocks服务器端的基本配置已经全部完成.
 
    
在本地机器mac上, 
wget https://github.com/oyyd/nysocks/releases/download/1.2.10/nysocks_v1.2.10_mac.zip
unzip  nysocks_v1.2.10_mac.zip

cd  nysocks

chmod 755 nysocks_v1.2.10_mac

 ./nysocks_v1.2.10_mac client -a my-vps-ip -p 20000 -k my-password -m fast --socks_port 1081
(--socks_port 1081的意思是指定本地机器所监听的socks端口为1081)
会显示:
...
info 2018-03-02 10:39:35: SOCKS5 service is listening on 1081
(一直要等到出现提示:SOCKS5 service is listening on 1081,保持这个终端窗口不关闭,然后即可去设置浏览器的socks5代理服务器为127.0.0.1:1081,浏览器即可成功翻墙)

项目地址:https://github.com/oyyd/nysocks/
下载地址:https://github.com/oyyd/nysocks/releases

翻墙速度还行。

No comments:

Post a Comment