Total Pageviews

Saturday, 25 August 2018

利用socks代理服务器程序socks5-server-by-isayme翻墙

登陆linux vps,首先安装nodejs环境。然后,
git clone https://github.com/isayme/socks5-server socks5-server-by-isayme
cd socks5-server-by-isayme


root@umh:~/socks5-server-by-isayme# ls
LICENSE  README.md  example  index.js  lib  package.json  test
root@umh:~/socks5-server-by-isayme# npm install
root@umh:~/socks5-server-by-isayme# ls

LICENSE  README.md  example  index.js  lib  node_modules  package.json test
root@umh:~/socks5-server-by-isayme# cd example
root@umh:~/socks5-server-by-isayme/example# ls
noauth.js  usernamepassword.js
root@umh:~/socks5-server-by-isayme/example# nano noauth.js
(把server.listen那行里的1080改为10890)
root@umh:~/socks5-server-by-isayme/example# node noauth.js
会显示:
server on {"address":"::","family":"IPv6","port":10890}

不过命令:node noauth.js是在前台运行的,我们可以利用systemd来把该命令运行为service:
nano /etc/systemd/system/socks5-server-by-isayme.service
内容为:
[Unit]
After=network.target

[Service]
WorkingDirectory=/root/socks5-server-by-isayme/
ExecStart=/usr/bin/node example/noauth.js
Restart=always

[Install]
WantedBy=multi-user.target

然后运行:
systemctl start socks5-server-by-isayme
systemctl enable socks5-server-by-isayme
服务器端搭建完成。

在本地机器上。
在chrome+switchyomega里设置一个代理服务器情景模式。代理协议为socks5,代理服务器的值为vps的ip,代理端口为10890,保存选项,chrome即可翻墙.

项目地址:https://github.com/isayme/socks5-server

No comments:

Post a Comment