Total Pageviews

Saturday, 9 April 2022

利用https proxy程序mutsuki翻墙

 登录Linux vps.

首先安装rust环境。参见https://briteming.blogspot.com/2016/06/shadowsocks-rust.html的顶部的蓝色文字

git clone https://github.com/xutianyi1999/mutsuki mutsuki-by-xutianyi1999

cd mutsuki-by-xutianyi1999

cargo build --release

稍等,在当前目录下,会生成target目录,

cd target/release

root@racknerd-7b97d8:~/mutsuki-by-xutianyi1999/target/release# ls

build  deps  examples  incremental  mutsuki  mutsuki.d

root@racknerd-7b97d8:~/mutsuki-by-xutianyi1999/target/release# cp ~/mutsuki-by-xutianyi1999/cfg-example/config.json ./

root@racknerd-7b97d8:~/mutsuki-by-xutianyi1999/target/release# ls

build  config.json  deps  examples  incremental  mutsuki  mutsuki.d

root@racknerd-7b97d8:~/mutsuki-by-xutianyi1999/target/release# nano config.json

root@racknerd-7b97d8:~/mutsuki-by-xutianyi1999/target/release# cat config.json

[

  {

    "protocol": "https",

    "bind_addr": "0.0.0.0:10800",

    "server_cert_key": {

      "cert_path": "/etc/letsencrypt/live/mydomain.com/fullchain.pem",

      "priv_key_path": "/etc/letsencrypt/live/mydomain.com/privkey.pem"

    }

}

]

root@racknerd-7b97d8:~/mutsuki-by-xutianyi1999/target/release# ./mutsuki config.json


不过命令./mutsuki config.json是运行在前台的,我们可以利用systemd把它运行为service:
nano 
/etc/systemd/system/mutsuki.service

cat /etc/systemd/system/mutsuki.service

显示:

[Unit]

After=network.target


[Service]

ExecStart=/root/mutsuki-by-xutianyi1999/target/release/mutsuki /root/mutsuki-by-xutianyi1999/target/release/config.json

Restart=always


[Install]

WantedBy=multi-user.target


然后,

systemctl start mutsuki


systemctl enable mutsuki


服务器端搭建完成。


然后在客户端机器mac或windows上的chrome浏览器的switchy omega插件里设置https proxy,地址为mydomain.com ,

端口为10800 ,浏览器即可翻墙。


项目地址:https://github.com/xutianyi1999/mutsuki

https://github.com/xutianyi1999/mutsuki/issues/1


相关帖子:https://briteming.blogspot.com/2018/07/https.html







No comments:

Post a Comment