在linux vps上,首先安装go环境,然后
cd $GOPATH
go get -u -v github.com/andrew-d/socks/
(在$GOPATH/bin/里面就会生成可执行文件socks)
socks -a 127.0.0.1 -p 5800
用systemd把socks -a 127.0.0.1 -p 5800 运行为service:
nano /etc/systemd/system/socks-by-andrew-d.service
其内容为:
项目地址:https://github.com/andrew-d/socks
cd $GOPATH
go get -u -v github.com/andrew-d/socks/
(在$GOPATH/bin/里面就会生成可执行文件socks)
socks -a 127.0.0.1 -p 5800
用systemd把socks -a 127.0.0.1 -p 5800 运行为service:
nano /etc/systemd/system/socks-by-andrew-d.service
其内容为:
[Unit]
After=network.target
[Service]
ExecStart=/root/go/gopath/bin/socks -a 127.0.0.1 -p 5800
Restart=always
[Install]
WantedBy=multi-user.target
然后,运行:
systemctl start socks-by-andrew-d
systemctl enable socks-by-andrew-d
服务器端搭建完成。
这个socks代理服务器程序可以用作各种tunnel程序的后端程序。
项目地址:https://github.com/andrew-d/socks