登陆linux vps.
git clone https://github.com/v3aqb/hxsocks
cd hxsocks
cp config.json.sample config.json
nano config.json
(把第2行的method改为aes-256-cfb,把pre-shared-password改为你的密码,把ip.address改为0.0.0.0 ,
把port改为你的端口号)
然后运行:
python hxsserver.py
不过这条命令python hxsserver.py是运行在前台的,容易退出,我们可以利用systemd来把该命令运行为service:
nano /etc/systemd/system/hxsocks.service
其内容为:
git clone https://github.com/v3aqb/hxsocks
cd hxsocks
cp config.json.sample config.json
nano config.json
(把第2行的method改为aes-256-cfb,把pre-shared-password改为你的密码,把ip.address改为0.0.0.0 ,
把port改为你的端口号)
然后运行:
python hxsserver.py
不过这条命令python hxsserver.py是运行在前台的,容易退出,我们可以利用systemd来把该命令运行为service:
nano /etc/systemd/system/hxsocks.service
其内容为:
[Unit]
Description=hxsocks
After=network.target
[Service]
ExecStart=/usr/bin/python /root/hxsocks/hxsserver.py
Restart=always
[Install]
WantedBy=multi-user.target
然后,systemctl start hxsocks (启动服务)
systemctl enable hxsocks (让该服务随vps的启动而启动)
然后,在客户机器上,在ss的客户端程序里填入你服务器的ip,你的端口号,你的密码,加密方式一栏填写aes-256-cfb。
hxsocks本身还有一个用法,我未完全弄懂。
项目地址:https://github.com/v3aqb/hxsocks