虽然一般使用sniproxy来实现sni代理,但作者已经基本上不维护了,因此我选择使用gost.

安装

我使用的是centos系统,因此前往gost项目地址:

https://github.com/ginuerzh/gost

选择合适的Releases下载:

https://github.com/ginuerzh/gost/releases/download/v2.11.0/gost-linux-amd64-2.11.0.gz

解压

gzip -d gost-linux-amd64-2.11.0.gz

解压出来的文件可以直接执行,你也可以重命名它以方便执行

mv gost-linux-amd64-2.11.0 gost

使用cp gost /usr/bin或者创建硬链接ln gost /usr/bin/gost均可

提示-bash: /usr/bin/gost: Permission denied就使用chmod +x /usr/bin/gost即可

尝试输入gost指令,若出现参数提示,则说明安装成功。
gost-install.png

使用

使用命令

gost -L sni://:443?whitelist=tcp:launcher.eveonline.com,resources.eveonline.com,binaries.eveonline.com:443

解释:

gost -L sni://:443  ##创建sni代理
whitelist=tcp:launcher.eveonline.com,resources.eveonline.com,binaries.eveonline.com:443  ##白名单,针对tcp连接下的launcher.eveonline.com,resources.eveonline.com,binaries.eveonline.com这三个域名的443端口

开机启动

新建启动文件

vi /etc/systemd/system/gost-eve.service

输入内容

[Unit]
Description=gost-eve
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/gost -L sni://:443?whitelist=tcp:launcher.eveonline.com,resources.eveonline.com,binaries.eveonline.com:443

[Install]
WantedBy=multi-user.target

相关命令

自启:systemctl enable gost-eve.service
启动:systemctl start gost-eve.service
停止:systemctl stop gost-eve.service
禁用:systemctl disable gost-eve.service

本脚本仅限加速github等国内直接访问缓慢的网站使用

config控制

使用config可以更好的添加白名单。
gost.config的写法如下:

{
    "Debug": true,
    "Retries": 0,
    "ServeNodes": [
        "sni://:443?whitelist=tcp:*.baidu.com,*.qq.com:443"
    ],
    "ChainNodes": [
        
    ]
}

systemctl的配置如下:

vi /etc/systemd/system/gost.service

[Unit]
Description=gost
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/gost -C /opt/gost/gost.json

[Install]
WantedBy=multi-user.target

参考:
ginuerzh/gost

最后修改:2020 年 10 月 18 日
如果觉得我的文章对你有用,请随意赞赏