-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
211 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ comments: true | |
|
||
=== "命令行" | ||
```bash | ||
gost -L tcp://:8080/192.168.1.1:80,192.168.1.2:80,192.168.1.3:8080?strategy=round&maxFails=1&failTimeout=30s | ||
gost -L "tcp://:8080/192.168.1.1:80,192.168.1.2:80,192.168.1.3:8080?strategy=round&maxFails=1&failTimeout=30s" | ||
``` | ||
=== "配置文件" | ||
|
||
|
@@ -73,9 +73,11 @@ comments: true | |
和TCP端口转发类似,也可以指定单个和多个目标转发地址。 | ||
|
||
=== "命令行" | ||
|
||
```bash | ||
gost -L udp://:10053/192.168.1.1:53,192.168.1.2:53,192.168.1.3:53?keepalive=true&ttl=5s | ||
gost -L "udp://:10053/192.168.1.1:53,192.168.1.2:53,192.168.1.3:53?keepalive=true&ttl=5s&readBufferSize=4096" | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
|
@@ -89,6 +91,7 @@ comments: true | |
metadata: | ||
keepAlive: true | ||
ttl: 5s | ||
readBufferSize: 4096 | ||
forwarder: | ||
nodes: | ||
- name: target-0 | ||
|
@@ -99,18 +102,25 @@ comments: true | |
addr: 192.168.1.3:53 | ||
``` | ||
|
||
每一个客户端对应一条转发通道,当`keepalive`参数设置为`false`时(默认情况),请求的响应数据返回给客户端后会立即关闭通道连接。 | ||
`keepalive` (bool, default=false) | ||
: 每一个客户端对应一条转发通道,当`keepalive`参数设置为`false`时(默认情况),请求的响应数据返回给客户端后会立即关闭通道连接。 | ||
|
||
`ttl` (duration, default=5s) | ||
: 当`keepalive`参数设置为`true`时,转发服务一定时间内收不到转发目标主机数据,此转发通道会被标记为空闲状态。转发服务内部会按照`ttl`参数(默认值5秒)指定的周期检查转发通道是否空闲,如果空闲则此通道将被关闭。一个空闲通道最多会在两个检查周期内被关闭。 | ||
|
||
当`keepalive`参数设置为`true`时,转发服务一定时间内收不到转发目标主机数据,此转发通道会被标记为空闲状态。转发服务内部会按照`ttl`参数(默认值5秒)指定的周期检查转发通道是否空闲,如果空闲则此通道将被关闭。一个空闲通道最多会在两个检查周期内被关闭。 | ||
`readBufferSize` (int, default=4096) | ||
: UDP读缓冲区大小,同时也是UDP数据包大小的上限,如果数据包大小超过此设定值,数据会被截断。 | ||
|
||
### 转发链 | ||
|
||
端口转发可以配合转发链进行间接转发。 | ||
|
||
=== "命令行" | ||
|
||
```bash | ||
gost -L=tcp://:8080/192.168.1.1:80 -F socks5://192.168.1.2:1080 | ||
gost -L tcp://:8080/192.168.1.1:80 -F socks5://192.168.1.2:1080 | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
|
@@ -142,9 +152,11 @@ comments: true | |
将本地的TCP端口8080通过转发链映射到192.168.1.1的80端口。 | ||
|
||
=== "命令行" | ||
|
||
```bash | ||
gost -L=udp://:10053/192.168.1.1:53 -F socks5://192.168.1.2:1080 | ||
gost -L udp://:10053/192.168.1.1:53 -F socks5://192.168.1.2:1080 | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
|
@@ -179,13 +191,17 @@ comments: true | |
当UDP本地端口转发中使用转发链时,转发链末端最后一个节点必须是以下类型: | ||
|
||
* GOST HTTP代理服务并开启了UDP转发功能,采用UDP-over-TCP方式。 | ||
``` | ||
|
||
```bash | ||
gost -L http://:8080?udp=true | ||
``` | ||
|
||
* GOST SOCKS5代理服务并开启了UDP转发功能,采用UDP-over-TCP方式。 | ||
``` | ||
|
||
```bash | ||
gost -L socks5://:1080?udp=true | ||
``` | ||
|
||
* Relay服务,采用UDP-over-TCP方式。 | ||
* SSU服务。 | ||
|
||
|
@@ -197,9 +213,11 @@ comments: true | |
TCP端口转发可以借助于标准SSH协议的端口转发功能进行间接转发 | ||
|
||
=== "命令行" | ||
|
||
```bash | ||
gost -L=tcp://:8080/192.168.1.1:80 -F sshd://user:pass@192.168.1.2:22 | ||
gost -L tcp://:8080/192.168.1.1:80 -F sshd://user:[email protected]:22 | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
|
@@ -234,10 +252,13 @@ TCP端口转发可以借助于标准SSH协议的端口转发功能进行间接 | |
这里的192.168.1.2:22服务可以是系统本身的标准SSH服务,也可以是GOST的sshd类型服务 | ||
|
||
=== "命令行" | ||
``` | ||
|
||
```bash | ||
gost -L sshd://user:pass@:22 | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
services: | ||
- name: service-0 | ||
|
@@ -256,9 +277,11 @@ TCP端口转发可以借助于标准SSH协议的端口转发功能进行间接 | |
### TCP | ||
|
||
=== "命令行" | ||
|
||
```bash | ||
gost -L rtcp://:8080/192.168.1.1:80 | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
|
@@ -280,9 +303,11 @@ TCP端口转发可以借助于标准SSH协议的端口转发功能进行间接 | |
### UDP | ||
|
||
=== "命令行" | ||
|
||
```bash | ||
gost -L rudp://:10053/192.168.1.1:53,192.168.1.2:53,192.168.1.3:53?ttl=5s | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
|
@@ -311,9 +336,11 @@ TCP端口转发可以借助于标准SSH协议的端口转发功能进行间接 | |
### 转发链 | ||
|
||
=== "命令行" | ||
|
||
```bash | ||
gost -L=rtcp://:8080/192.168.1.1:80 -F socks5://192.168.1.2:1080 | ||
gost -L rtcp://:8080/192.168.1.1:80 -F socks5://192.168.1.2:1080 | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
|
@@ -345,9 +372,11 @@ TCP端口转发可以借助于标准SSH协议的端口转发功能进行间接 | |
根据rtcp服务指定的地址,通过转发链在主机192.168.1.2上监听8080TCP端口。当收到请求后再通过转发链将数据转发给rtcp服务,rtcp服务再将请求转发到192.168.1.1:80端口。 | ||
|
||
=== "命令行" | ||
|
||
```bash | ||
gost -L=rudp://:10053/192.168.1.1:53 -F socks5://192.168.1.2:1080 | ||
gost -L rudp://:10053/192.168.1.1:53 -F socks5://192.168.1.2:1080 | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
|
@@ -388,11 +417,14 @@ TCP端口转发可以借助于标准SSH协议的端口转发功能进行间接 | |
当远程端口转发中使用转发链时,转发链末端最后一个节点必须是以下类型: | ||
|
||
* GOST SOCKS5代理服务并开启了BIND功能,采用UDP-over-TCP方式。 | ||
``` | ||
|
||
```bash | ||
gost -L socks5://:1080?bind=true | ||
``` | ||
|
||
* Relay服务并开启了BIND功能,采用UDP-over-TCP方式。 | ||
``` | ||
|
||
```bash | ||
gost -L relay://:8421?bind=true | ||
``` | ||
|
||
|
@@ -401,9 +433,11 @@ TCP端口转发可以借助于标准SSH协议的端口转发功能进行间接 | |
TCP远程端口转发可以借助于标准SSH协议的远程端口转发功能进行间接转发 | ||
|
||
=== "命令行" | ||
|
||
```bash | ||
gost -L=rtcp://:8080/192.168.1.1:80 -F sshd://user:pass@192.168.1.2:22 | ||
gost -L rtcp://:8080/192.168.1.1:80 -F sshd://user:[email protected]:22 | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
|
@@ -492,9 +526,11 @@ services: | |
### 服务端 | ||
=== "命令行" | ||
```bash | ||
gost -L tls://:8443/192.168.1.1:80 | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
|
@@ -513,9 +549,11 @@ services: | |
### 客户端 | ||
|
||
=== "命令行" | ||
|
||
```bash | ||
gost -L=tcp://:8080 -F forward+tls://:8443 | ||
gost -L tcp://:8080 -F forward+tls://:8443 | ||
``` | ||
|
||
=== "配置文件" | ||
|
||
```yaml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.