Skip to content

Commit

Permalink
update tutorials
Browse files Browse the repository at this point in the history
  • Loading branch information
ginuerzh committed Dec 27, 2024
1 parent dfe1ac1 commit d2d47a5
Show file tree
Hide file tree
Showing 6 changed files with 205 additions and 2 deletions.
60 changes: 59 additions & 1 deletion docs/tutorials/port-forwarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,66 @@ TCP远程端口转发可以借助于标准SSH协议的远程端口转发功能

命令行模式下支持使用端口范围格式。

### 多对一转发

```bash
gost -L tcp://:8000-8003/192.168.1.1:8000
```

等价于

```yaml
services:
- name: service-0
addr: :8000
handler:
type: tcp
listener:
type: tcp
forwarder:
nodes:
- name: target-0
addr: 192.168.1.1:8000
- name: service-1
addr: :8001
handler:
type: tcp
listener:
type: tcp
forwarder:
nodes:
- name: target-0
addr: 192.168.1.1:8000
- name: service-2
addr: :8002
handler:
type: tcp
listener:
type: tcp
forwarder:
nodes:
- name: target-0
addr: 192.168.1.1:8000
- name: service-3
addr: :8003
handler:
type: tcp
listener:
type: tcp
forwarder:
nodes:
- name: target-0
addr: 192.168.1.1:8000
```
### 多对多转发
多对多转发会根据定义的端口范围按顺序进行一对一映射。如果目标端口范围大于监听端口范围,则多余部分会被忽略。
在下面的例子中,8000-8003端口会按顺序依次映射到192.168.1.1:8000-8003,而192.168.1.1:8004-8010会被忽略。
```bash
gost -L tcp://:8000-8003/192.168.1.1:8000-8003
gost -L tcp://:8000-8003/192.168.1.1:8000-8010
```

等价于
Expand Down
43 changes: 43 additions & 0 deletions docs/tutorials/protocols/obfs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
comments: true
---

# Simple-obfs

Simple-obfs是GOST支持的一种数据通道类型。

Simple-obfs兼容[shadowsocks/simple-obfs](https://github.com/shadowsocks/simple-obfs)和Android上的[Simple Obfuscation](https://play.google.com/store/apps/details?id=com.github.shadowsocks.plugin.obfs_local)插件。

## 使用说明

### obfs-http

**服务端**

```bash
gost -L=ss+ohttp://chacha20:123456@:8338
```

**客户端**

```bash
gost -L=:8080 -F=ss+ohttp://chacha20:123456@server_ip:8338?host=bing.com
```

客户端可以通过`host`参数自定义请求Host。

### obfs-tls

**服务端**

```bash
gost -L=ss+otls://chacha20:123456@:8338
```

**客户端**

```bash
gost -L=:8080 -F=ss+otls://chacha20:123456@server_ip:8338?host=bing.com
```

客户端可以通过`host`参数自定义请求Host。
59 changes: 58 additions & 1 deletion en/docs/tutorials/port-forwarding.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,11 +477,13 @@ The 192.168.1.2:22 service here can be the standard SSH service of the system it

The port range format is supported in command line mode.

### Many-to-One

```bash
gost -L tcp://:8000-8003/192.168.1.1:8000-8003
```

It is equivalent to:
is equivalent to:

```yaml
services:
Expand Down Expand Up @@ -527,6 +529,61 @@ services:
addr: 192.168.1.1:8003
```
### Many-to-Many
Many-to-many forwarding will map one-to-one in order according to the defined port range. If the target port range is larger than the listening port range, the excess will be ignored.
In the following example, ports 8000-8003 will be mapped to 192.168.1.1:8000-8003 in order, while 192.168.1.1:8004-8010 will be ignored.
```bash
gost -L tcp://:8000-8003/192.168.1.1:8000-8010
```

is equivalent to:

```yaml
services:
- name: service-0
addr: :8000
handler:
type: tcp
listener:
type: tcp
forwarder:
nodes:
- name: target-0
addr: 192.168.1.1:8000
- name: service-1
addr: :8001
handler:
type: tcp
listener:
type: tcp
forwarder:
nodes:
- name: target-1
addr: 192.168.1.1:8001
- name: service-2
addr: :8002
handler:
type: tcp
listener:
type: tcp
forwarder:
nodes:
- name: target-2
addr: 192.168.1.1:8002
- name: service-3
addr: :8003
handler:
type: tcp
listener:
type: tcp
forwarder:
nodes:
- name: target-3
addr: 192.168.1.1:8003
```
## Server-side Forwarding
The above forwarding method can be regarded as client forwarding, and the client controls the forwarding target address. The target address can also be specified by the server.
Expand Down
43 changes: 43 additions & 0 deletions en/docs/tutorials/protocols/obfs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
comments: true
---

# Simple-obfs

Simple-obfs is a data channel type.

It is compatible with [shadowsocks/simple-obfs](https://github.com/shadowsocks/simple-obfs) and Android [Simple Obfuscation](https://play.google.com/store/apps/details?id=com.github.shadowsocks.plugin.obfs_local) plugin.

## Usage

### obfs-http

**Server**

```bash
gost -L=ss+ohttp://chacha20:123456@:8338
```

**Client**

```bash
gost -L=:8080 -F=ss+ohttp://chacha20:123456@server_ip:8338?host=bing.com
```

The client can customize the request host through the `host` parameter.

### obfs-tls

**Server**

```bash
gost -L=ss+otls://chacha20:123456@:8338
```

**Client**

```bash
gost -L=:8080 -F=ss+otls://chacha20:123456@server_ip:8338?host=bing.com
```

The client can customize the request host through the `host` parameter.
1 change: 1 addition & 0 deletions en/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ nav:
- SSH: tutorials/protocols/ssh.md
- MTCP: tutorials/protocols/mtcp.md
- PHT: tutorials/protocols/pht.md
- Obfs: tutorials/protocols/obfs.md
- WebAPI:
- Overview: tutorials/api/overview.md
- Dynamic Configuration: tutorials/api/config.md
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ nav:
- SSH: tutorials/protocols/ssh.md
- MTCP: tutorials/protocols/mtcp.md
- PHT: tutorials/protocols/pht.md
- Obfs: tutorials/protocols/obfs.md
- WebAPI:
- 概述: tutorials/api/overview.md
- 动态配置: tutorials/api/config.md
Expand Down

0 comments on commit d2d47a5

Please sign in to comment.