Skip to content
forked from go-gost/gost

GO Simple Tunnel - Over Powered Edition

License

Notifications You must be signed in to change notification settings

CloudPassenger/gost

 
 

Repository files navigation

GO Simple Tunnel - 威力加强版

加强特性

  • QUIC:默认改用 BBR,加入 Hysteria 同款 Brutal 固定速率流控
  • REALITY:支持 Xray 同款 REALITY 安全传输层,可作为服务器及客户端,支持多路复用
  • Forward:流量转发支持 Proxy Protocol 传递客户端IP(仅支持TCP)

配置示例

QUIC + Brutal

最简配置命令行(服务端)

gost -L http+quic://:6666?recvMbps=100

最简配置命令行(客户端)

gost -L http://:10880 -F http+quic://myserver.ltd:6666?sendMbps=100

详细配置(服务端)

services:
- name: service-0
  addr: :6666
  handler:
    type: http
  listener:
    type: quic
    metadata:
      recvMbps: 100
      maxStreams: 1024
      initStreamReceiveWindow: 8388608
      maxStreamReceiveWindow: 8388608
      initConnReceiveWindow: 20971520
      maxConnReceiveWindow: 20971520
      DisablePathMTUDiscovery: false

详细配置(客户端)

services:
- name: service-0
  addr: ":10880"
  handler:
    type: http
    chain: chain-0
  listener:
    type: tcp
chains:
- name: chain-0
  hops:
  - name: hop-0
    nodes:
    - name: node-0
      addr: myserver.ltd:6666
      connector:
        type: http
      dialer:
        type: quic
        metadata:
          sendMbps: 100
          maxStreams: 1024
          initStreamReceiveWindow: 8388608
          maxStreamReceiveWindow: 8388608
          initConnReceiveWindow: 20971520
          maxConnReceiveWindow: 20971520
          DisablePathMTUDiscovery: false

Note

具体参数请参考 Hysteria 文档 QUIC 配置部分,参数含义一致

Warning

使用 Brutal 固定速率发送时务必提前确认服务器参数,错误的配置会导致网络拥堵甚至崩溃,也可能会因为暴力发包而被主机商停用或运营商限制网络

REALITY

最简配置命令行(服务端)

gost -L="http+tlr://:8888?dest=ocsp.apple.com:443&privateKey=OAKBrpGrtUUGzdYbtqNSMrBeAbLZfmd6w3tdesPCPUo&serverNames=ocsp.apple.com&shortIds=cafe123456780000"

Tip

拨号器名称 可使用 tlrreality,如多路复用可使用 mtlrmreality TLR 为 Transport Layer REALITY(传输层现实协议) 的缩写

最简配置命令行(客户端)

gost -L http://:10880 -F="http+tlr://myserver.tld:8888?serverName=ocsp.apple.com&publicKey=XslBGcN9ChALOZRiDWmh6CfgwvJ8n9cx65egDAnNUzQ&shortId=cafe123456780000"

详细配置(服务端)

services:
- name: service-0
  addr: :8888
  handler:
    type: http
  listener:
    type: reality
    reality:
      show: false
      xver: 0
      dest: "ocsp.apple.com:443"
      privateKey: "OAKBrpGrtUUGzdYbtqNSMrBeAbLZfmd6w3tdesPCPUo"
      maxTimeDiff: 30m
      serverNames:
        - "ocsp.apple.com"
      shortIds:
        - "cafe123456780000"

详细配置(客户端)

services:
- name: service-0
  addr: ":10880"
  handler:
    type: http
    chain: chain-0
  listener:
    type: tcp
chains:
- name: chain-0
  hops:
  - name: hop-0
    nodes:
    - name: node-0
      addr: myserver.tld:8888
      connector:
        type: http
      dialer:
        type: reality
        reality:
          show: false
          serverName: ocsp.apple.com
          publicKey: XslBGcN9ChALOZRiDWmh6CfgwvJ8n9cx65egDAnNUzQ
          shortId: cafe123456780000

Note

具体参数请参考 Xray 文档 RealityObject 配置部分,参数含义一致

Forward 发送 Proxy Protocol

仅支持在配置文件中使用,仅支持 TCP 协议

services:
- name: service-0
  addr: :8080
  handler:
    type: tcp
  listener:
    type: tcp
  forwarder:
    nodes:
    - name: target-0
      addr: 192.168.1.1:80
  metadata:
    sendProxy: 2 # 0: 不发送,1: 发送 Proxy Protocol v1,2: 发送 Proxy Protocol v2

兼容所有代理链,会在收到转发数据时附加 Proxy Protocol 头部,转发给目标节点

相关项目

  • Hysteria - 强大、快速、抗审查的代理工具
  • quic-go - 修改版 quic-go,支持 Hysteria 的 Brutal 流控 及 BBR
  • Xray - 网络代理工具合集
  • REALITY - 一个用于隐匿特征的安全传输层

以下是原介绍

GO语言实现的安全隧道

zh en

功能特性

概览

Overview

GOST作为隧道有三种主要使用方式。

正向代理

作为代理服务访问网络,可以组合使用多种协议组成转发链进行转发。

Proxy

端口转发

将一个服务的端口映射到另外一个服务的端口,同样可以组合使用多种协议组成转发链进行转发。

Forward

反向代理

利用隧道和内网穿透将内网服务暴露到公网访问。

Reverse Proxy

下载安装

二进制文件

https://github.com/go-gost/gost/releases

安装脚本

# 安装最新版本 [https://github.com/go-gost/gost/releases](https://github.com/go-gost/gost/releases)
bash <(curl -fsSL https://github.com/go-gost/gost/raw/master/install.sh) --install
# 选择要安装的版本
bash <(curl -fsSL https://github.com/go-gost/gost/raw/master/install.sh)

源码编译

git clone https://github.com/go-gost/gost.git
cd gost/cmd/gost
go build

Docker

docker run --rm gogost/gost -V

工具

GUI

go-gost/gostctl

WebUI

cnwhy/gost-ui

Shadowsocks Android插件

xausky/ShadowsocksGostPlugin

帮助与支持

Wiki站点:https://gost.run

YouTube: https://www.youtube.com/@gost-tunnel

Telegram:https://t.me/gogost

Google讨论组:https://groups.google.com/d/forum/go-gost

旧版入口:v2.gost.run

About

GO Simple Tunnel - Over Powered Edition

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 84.3%
  • Makefile 8.4%
  • Shell 6.1%
  • Dockerfile 1.2%