使用GOST搭建高效安全的代理服务器
简介
GOST(GO Simple Tunnel)是一个强大的、多功能的安全隧道和代理服务器。本文将指导您如何安装、配置和运行GOST,以建立一个可靠的代理服务器。
## 安装GOST
二进制文件
https://github.com/ginuerzh/gost/releases
源码编译
git clone https://github.com/ginuerzh/gost.git
cd gost/cmd/gost
go build
Docker
docker run --rm ginuerzh/gost -V
Homebrew
brew install gost
Ubuntu商店
sudo snap install core
sudo snap install gost
快速启动
- 作为标准HTTP/SOCKS5代理
gost -L=:8080
- 设置代理认证信息
gost -L=admin:123456@localhost:8080
- 多端口监听
gost -L=http2://:443 -L=socks5://:1080 -L=ss://aes-128-cfb:123456@:8338
不过,建议使用:
gost -L=socks5://admin:[email protected]:8080
后台运行
为了让GOST在后台持续运行,我们可以将其配置为系统服务:
- 创建服务文件:
sudo nano /etc/systemd/system/gost.service
- 添加以下内容:
[Unit]
Description=GOST Proxy Service
After=network.target
[Service]
ExecStart=/snap/bin/gost -L=socks5://admin:[email protected]:8080
Restart=on-failure
User=root
[Install]
WantedBy=multi-user.target
- 启用并运行服务:
sudo systemctl daemon-reload
sudo systemctl enable gost
sudo systemctl start gost
当然如果为了方便可以直接使用nohup
命令:
nohup gost -L=socks5://admin:[email protected]:8080 > gost.log 2>&1 &
了解更多
参考:https://github.com/ginuerzh/gost
© 版权声明
THE END
暂无评论内容