出国旅游攻略

吞我的博文?吃枣药丸

关键字用 mua 代替

Debian 10.7

# apt-get update -y && apt-get upgrade -y

# apt-get install mua-libev simple-obfs -y

# vim /etc/mua-libev/config-obfs.json

{
    "server":"0.0.0.0",
    "server_port":8080,
    "local_port":1080,
    "password":"Changeme_123",
    "timeout":60,
    "method":"xchacha20-ietf-poly1305",
    "mode":"tcp_and_udp",
    "fast_open":true,
    "plugin":"obfs-server",
    "plugin_opts":"obfs=tls;failover=github.com:80;fast-open"
}

# vim /etc/default/mua-libev

# >>> 是原始的,<<< 是修改的
>>> CONFFILE="/etc/mua-libev/config.json"
<<< CONFFILE="/etc/mua-libev/config-obfs.json"

# systemctl restart mua-libev && systemctl status mua-libev

Linux 客户端

  • # sudo pacman -S mua-libev simple-obfs

  • # sudo mkdir /etc/mua

  • # sudo vim /etc/mua/cfg.json

{
    "server":"${server_ip}",
    "server_port":${server_port},
    "local_address":"127.0.0.1",
    "local_port":1080,
    "password":"Changeme_123",
    "timeout":60,
    "method":"xchacha20-ietf-poly1305",
    "mode":"tcp_and_udp",
    "fast_open":true,
    "plugin":"obfs-local",
    "plugin_opts":"obfs=tls;obfs-host=github.com;fast-open"
}
  • # sudo vim /usr/lib/systemd/system/mua.service
[Unit]
Description=mua-libev

[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/ss-local -c /etc/mua/cfg.json

[Install]
WantedBy=multi-user.target
  • # sudo systemctl start mua && sudo systemctl enable mua && sudo systemctl status mua

  • # sudo pacman -S privoxy

  • # sudo bash -c 'echo "forward-socks5 / 127.0.0.1:1080 ." >> /etc/privoxy/config',如果想局域网共享,把 listen-address 值 IP 值改为 0.0.0.0 即可,max-client-connections 建议也调大,不然可能会碰到 failed to establish tunnel (503 Too many open connections) 的报错

  • # sudo systemctl start privoxy && sudo systemctl enable privoxy && sudo systemctl status privoxy

  • # export http_proxy="http://localhost:8118"

  • # export https_proxy="http://localhost:8118"

  • # google-chrome-stable 就可以直接不用插件打开了

MAC 客户端

brew 大同小异的安装,不过在配插件必须要填绝对路径,相对路径会导致 brew services start 成功但是实际启动不起来,而手动执行命令又没问题的怪异情况

其次是直接用 Privoxy 是可以使用 PAC 模式的,使用 列表生成器 生成一个 action 文件,删除上面的 forward-socks5 内容,改成 actionsfile pac.action 即可,生成器用不了的话可以考虑手写如下格式。

{+forward-override{forward-socks5 127.0.0.1:1080 .}}
.github.com

再在 ~/.zshrc 里配置一下 http.... 的全局了

posted @ 2018-12-25 15:29  seliote  阅读(245)  评论(0)    收藏  举报