Total Pageviews

Tuesday, 24 August 2021

利用shadowsocks-by-cssivision翻墙

 在linux vps上。首先搭建go环境。然后,

cd $GOPATH
go get -u -v github.com/cssivision/shadowsocks/cmd/ssserver/

在$GOPATH/bin/下,就会生成可执行文件ssserver。

cd ~

nano shadowsocks-by-cssivision-config.json

其内容为:

{

"server_addr": ":27089",

"password": "mypassword",

"method": "aes-256-cfb",

"timeout": 300

}


然后运行:

ssserver -c ~/shadowsocks-by-cssivision-config.json

不过此命令是运行在前台的,我们可以利用systemd把它运行为service;

nano /etc/systemd/system/shadowsocks-by-cssivision.service

其内容为:

[Unit]

After=network.target


[Service]

ExecStart=$GOPATH/bin/ssserver -c /root/shadowsocks-by-cssivision-config.json

Restart=always


[Install]

WantedBy=multi-user.target


然后运行;

systemctl start shadowsocks-by-cssivision

systemctl enable shadowsocks-by-cssivision


服务器端搭建完成。


在客户机器mac上。首先搭建go环境。然后,

cd $GOPATH
go get -u -v github.com/cssivision/shadowsocks/cmd/sslocal

在$GOPATH/bin/下,就会生成可执行文件sslocal.

cd $GOPATH/bin/

mv sslocal sslocal-by-cssivision_shadowsocks

cd ~

nano shadowsocks-cssivision-config.json

其内容为:

{

"server_addr": "vps-public-ip:27089",

"password": "mypassword",

"local_addr": ":1080",

"method": "aes-256-cfb",

"timeout": 300

}


然后运行:

$GOPATH/bin/sslocal-by-cssivision_shadowsocks -c ~/shadowsocks-cssivision-config.json

不要关闭这个terminal,然后设置浏览器的socks5代理服务器地址为127.0.0.1 ,端口为1080 ,浏览器即可翻墙。


当然,你也可以不用这个客户端命令,而使用其它的ss客户端的gui程序,填入那相应的4个参数的值。


项目地址;https://github.com/cssivision/shadowsocks


No comments:

Post a Comment