在受限的VPS环境下 使用233boy的sing-box脚本
LT; DR
bash <(wget -qO- -o- https://gh-proxy.org/https://github.com/233boy/sing-box/raw/main/install.sh | sed s#one\.one\.one\.one#www.cloudflare.com#gi)
find /etc/sing-box/sh -type f -name "*.sh" -exec sed -i 's#one\.one\.one\.one/dns-query#dns.alidns.com/resolve#gi' {} +find /etc/sing-box/sh -type f -name "*.sh" -exec sed -i 's#one\.one\.one\.one#www.cloudflare.com#gi' {} +
1. 访问github资源的问题
1.a) 翻墙脚本里面一般还会获取github资源(脚本或压缩包).
而如果github proxy只解决了获取github脚本本身的问题, 那么脚本运行起来了之后, 获取github资源还是会失败.
所以我们需要能处理 github脚本嵌套调用 的 github proxy.
最早的 https://github.com/hunshcn/gh-proxy 就没有处理github脚本的嵌套调用
而 https://github.com/crazypeace/ghproxy 就处理了github脚本的嵌套调用
所以如果你用到的github proxy发现脚本跑起来了, 但是下载github资源报错, 说明没有处理github脚本的嵌套调用. 那么你需要换一个github proxy, 或者自己搭一个.
1.b) 常见的github proxy是用域名访问的.
那么你的VPS厂商是有可能在网络环境针对github proxy域名进行屏蔽的.
所以如果你发现一开始github脚本就拉不下来, 你可以用 curl 访问一下 github proxy 看能否得到 html结果, 如果得不到, 说明被屏蔽了. 那么你需要换一个github proxy, 或者自己搭一个.
bash <(wget -qO- -o- https://gh-proxy.org/https://github.com/233boy/sing-box/raw/main/install.sh)
2. 检测服务器自身IP的问题
bash <(wget -qO- -o- https://gh-proxy.org/https://github.com/233boy/sing-box/raw/main/install.sh | sed s#one\.one\.one\.one#www.cloudflare.com#gi)
========
安装后, 使用菜单添加配置时, 还会遇到问题.
因为VPS上面安装的脚本的内容是从github下载压缩包再解决的, 所以脚本内容在检测服务器IP和查询域名DNS方面还是有问题.
查询域名DNS的问题
find /etc/sing-box/sh -type f -name "*.sh" -exec sed -i 's#one\.one\.one\.one/dns-query#dns.alidns.com/resolve#gi' {} +
检测服务器自身IP的问题
find /etc/sing-box/sh -type f -name "*.sh" -exec sed -i 's#one\.one\.one\.one#www.cloudflare.com#gi' {} +
========
后记
233boy的v2ray脚本
bash <(wget -qO- -o- https://gh-proxy.org/https://github.com/233boy/v2ray/raw/master/install.sh | sed s#one\.one\.one\.one#www.cloudflare.com#gi)
find /etc/v2ray/sh -type f -name "*.sh" -exec sed -i 's#one\.one\.one\.one/dns-query#dns.alidns.com/resolve#gi' {} +find /etc/v2ray/sh -type f -name "*.sh" -exec sed -i 's#one\.one\.one\.one#www.cloudflare.com#gi' {} +
233boy的xray脚本
安装命令
bash <(wget -qO- -o- https://gh-proxy.org/https://github.com/233boy/Xray/raw/main/install.sh | sed s#one\.one\.one\.one#www.cloudflare.com#gi)
维护, 在安装完成之后
find /etc/xray/sh -type f -name "*.sh" -exec sed -i 's#one\.one\.one\.one/dns-query#dns.alidns.com/resolve#gi' {} +
find /etc/xray/sh -type f -name "*.sh" -exec sed -i 's#one\.one\.one\.one#www.cloudflare.com#gi' {} +
========
还有一个办法就是劫持脚本的网络访问, 改为替代命令或替代操作.
评论
发表评论