使用Gost V3搭建转发端口服务器,转发网速比Haproxy快2倍 包含Docker方法

‌一、GostV3 二进制文件下载;

gost 文件下载后,上传到root/gost/目录下,然后给Gost设置权限

gost.yml配置文件放在同一个目录后运行,下面的命令启动即可;

./gost #启动调试模式
nohup /root/gost/gost & #后台运行gost

二、把Gost加入服务,开机启动

/etc/systemd/system/gost.service #创建gost.service文件

#文件内容如下
[Unit]
Description=GO Simple Tunnel
After=network.target
Wants=network.target

[Service]
Type=simple
ExecStart=/root/gost/gost
Restart=always

[Install]
WantedBy=multi-user.target

设为开机启动

systemctl enable gost

启动服务

systemctl start gost

三、Docker搭建方法

本地配置文件,路径/root/gost/gost.yml

services:
- name: service-1
  addr: ":3810"
  handler:
    type: http
    chain: chain-1
    auth:
      username: admin
      password: pass
  listener:
    type: tcp

- name: service-2
  addr: ":3811"
  handler:
    type: http
    chain: chain-2
  listener:
    type: tcp

#后端代理配置

chains:
- name: chain-1
  hops:
  - name: hop-0
    nodes:
    - name: node-0
      addr: 154.9.242.175:3003
      connector:
        type: http

- name: chain-2
  hops:
  - name: hop-0
    nodes:
    - name: node-0
      addr: 154.9.242.175:3003
      connector:
        type: http

‌docker 启动命令

docker run -d --network=host --restart=always -v /root/gost/gost.yml:/etc/gost/gost.yml --name gost gogost/gost

使用GOST搭建多端口 多转发HTTPS代理 可设置账号密码- 搭建单个代理+转发

下面的配置文件保存为 gost.yml
#配置文件
services:
- name: service-1
  addr: ":3800"
  handler:
    type: http
    chain: chain-1
    auth:
      username: admin
      password: pass
  listener:
    type: tls

#后端代理配置
chains:
- name: chain-1
  hops:
  - name: hop-0
    nodes:
    - name: node-0
      addr: 47.245.89.62:6919
      connector:
        type: http
tls:
  certFile: "/cert/fullchain.pem"
  keyFile: "/cert/privkey.pem"

‌后端代理如何配置账号密码

#配置文件
services:
- name: service-1
  addr: ":3801"
  handler:
    type: http
    chain: chain-1
  listener:
    type: tls

#后端代理配置
chains:
- name: chain-1
  hops:
  - name: hop-0
    nodes:
    - name: node-0
      addr: dc.smartproxy.com:10000
      connector:
        type: http
        auth:
            username: admin
            password: admin888
tls:
  certFile: "/cert/fullchain.pem"
  keyFile: "/cert/privkey.pem"

设置好目录映射,并启动docker
docker run -d \
--network=host \
--restart=always \
-v /root/gost/gost.yml:/etc/gost/gost.yml \
-v /root/gost/fullchain.pem:/cert/fullchain.pem:rw \
-v /root/gost/privkey.pem:/cert/privkey.pem:rw  \
--name gost_https \
gogost/gost

使用GOST搭建多端口 多转发HTTPS代理 可设置账号密码- 搭建多代理+多转发

下面的配置文件保存为 gost.yml
#配置文件
services:
- name: service-1
  addr: ":13800"
  handler:
    type: http
    chain: chain-1
    auth:
      username: admin
      password: pass
  listener:
    type: tls

- name: service-2
  addr: ":13801"
  handler:
    type: http
    chain: chain-2
    auth:
      username: admin
      password: pass
  listener:
    type: tls

- name: service-3
  addr: ":13802"
  handler:
    type: http
    chain: chain-3
    auth:
      username: admin
      password: pass
  listener:
    type: tls



#后端代理配置
chains:
- name: chain-1
  hops:
  - name: hop-0
    nodes:
    - name: node-0
      addr: 127.0.0.1:6666
      connector:
        type: http

- name: chain-2
  hops:
  - name: hop-0
    nodes:
    - name: node-0
      addr: 127.0.0.1:6666
      connector:
        type: http

- name: chain-3
  hops:
  - name: hop-0
    nodes:
    - name: node-0
      addr: 127.0.0.1:6666
      connector:
        type: http
tls:
  certFile: "/cert/fullchain.pem"
  keyFile: "/cert/privkey.pem"

设置好目录映射,并启动docker
docker run -d \
--network=host \
--restart=always \
-v /root/gost/gost.yml:/etc/gost/gost.yml \
-v /root/gost/fullchain.pem:/cert/fullchain.pem:rw \
-v /root/gost/privkey.pem:/cert/privkey.pem:rw  \
--name gost_https \
gogost/gost

如果您喜欢本站,点击这儿不花一分钱捐赠本站

这些信息可能会帮助到你:下载帮助 | 报毒说明 | 进站必看

修改版本安卓软件,加群提示为修改者自留,非本站信息,注意鉴别

(0)

发表回复

评论问题之前, 点击我,能帮你解决大部分问题

评论列表(0条)

请用支付宝扫一扫完成支付