Total Pageviews

Saturday 16 May 2020

利用go-socks5-by-xiangrui2019翻墙 (连接并没有被加密,不建议使用)

登陆Linux vps.首先安装go1.13环境,然后,
git clone https://github.com/Xiangrui2019/go-socks5 go-socks5-by-Xiangrui2019
cd go-socks5-by-Xiangrui2019
cd ./app/gosocks5-server/;go install
这样,可执行文件gosocks5-server就会出现在$GOBIN/里面。
cd ../../


mkdir /app/
cp config.example.json /app/config.json
nano /app/config.json
cat /app/config.json
{
"listen": ":5448",
"remote": "",
"password": "你的密码不要修改,暂时只能使用作者所设的密码"
}

然后,运行:
gosocks5-server
会显示:
config.go:40: 从文件 /app/config.json 中读取配置
config.go:34: 保存配置到文件 /app/config.json 成功
main.go:31: 使用配置: 
本地监听地址 listen:
[::]:5448
密码 password:
你的密码
main.go:37: gosocks5-server 启动成功 监听在 [::]:5448

此命令gosocks5-server是运行在前台的,可以利用systemd把它运行为service:
nano /etc/systemd/system/go-socks5-by-xiangrui2019.service
cat /etc/systemd/system/go-socks5-by-xiangrui2019.service
[Unit]
After=network.target

[Service]
WorkingDirectory=/app/
ExecStart=/root/go/gopath/bin/gosocks5-server
Restart=always

[Install]
WantedBy=multi-user.target

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

在本地机器mac上。首先安装go1.13环境,然后,
git clone https://github.com/Xiangrui2019/go-socks5 go-socks5-by-Xiangrui2019
cd go-socks5-by-Xiangrui2019
cd ./app/gosocks5-local/;go install
这样,可执行文件gosocks5-local就会出现在$GOBIN/里面。
cd ../../

mkdir /app/
cp config.example.json /app/config.json
nano /app/config.json
cat /app/config.json
{
"listen": ":5449",
"remote": "vps-public-ip:5448",
"password": "你的密码不要修改,暂时只能使用作者所设的密码"
}

然后,运行:
sudo gosocks5-local
不要关闭此窗口,
然后设置浏览器的socks5代理服务器地址为127.0.0.1,端口为5449,浏览器即可翻墙。


No comments:

Post a Comment