Skip to content

Commit

Permalink
g3proxy: update user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
zh-jq-b committed Nov 3, 2023
1 parent 2290ea8 commit 93c1eaf
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions g3proxy/UserGuide.zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ server:
### TLS卸载
本地TCP端口映射到目标机器的TLS端口需要添加TcpStream类型入口,示例如下:
本地TCP端口映射到目标机器的TLS端口需要添加TcpStream类型入口,示例如下:
```yaml
server:
Expand All @@ -191,7 +191,9 @@ server:
### TLS封装
本地TLS端口映射到目标机器的特定端口,需要添加TlsStream类型入口,示例如下:
本地TLS端口映射到目标机器的特定端口。
可添加TlsStream类型入口,示例如下:
```yaml
server:
Expand All @@ -204,13 +206,36 @@ server:
cert_pairs:
certificate: /path/to/cert
private_key: /path/to/key
enable_client_auth: true # 启用mTLS
enable_client_auth: true # 可选启用mTLS
proxy_pass: # 目标地址,可以单条/多条
- "127.0.0.1:5201"
- "127.0.0.1:5202"
upstream_pick_policy: rr # 负载均衡算法,默认random
```
或使用PlainTlsPort串联TcpStream,示例如下:
```yaml
server:
- name: tcp
escaper: default
type: tcp_stream
proxy_pass: # 目标地址,可以单条/多条
- "127.0.0.1:5201"
- "127.0.0.1:5202"
upstream_pick_policy: rr # 负载均衡算法,默认random
- name: tls
type: plain_tls_port
listen:
address: "[::1]:10443"
tls_server: # 配置TLS参数
cert_pairs:
certificate: /path/to/cert
private_key: /path/to/key
enable_client_auth: true # 可选启用mTLS
server: tcp # 指向tcp stream服务
```
### SNI代理
自动识别TLS SNI / HTTP Host头中的目标地址,并转发,需要添加SniProxy类型入口,示例如下:
Expand Down Expand Up @@ -487,7 +512,7 @@ server:
cert_pairs:
certificate: /path/to/certificate
private_key: /path/to/private_key
enable_client_auth: true # 开启mTLS
enable_client_auth: true # 可选开启mTLS
```
Port类型入口仅有独立的Listen监控,流量监控、日志都是在下一跳Server处理的,在规划时需要考虑清楚是串联Port还是拆分Server更合适。
Expand Down Expand Up @@ -527,6 +552,13 @@ server:
- name: tlcp
type: native_tls_port
listen: "[::]:443"
tls_server:
tlcp_cert_pairs: # 启用国密TLCP协议
sign_certificate: /path/to/sign.crt
sign_private_key: /path/to/sign.key
enc_certificate: /path/to/enc.crt
enc_private_key: /path/to/enc.key
enable_client_auth: true # 可选启用mTLS
server: real_http
proxy_protocol: v2 # 可选启用PROXY Protocol
```
Expand Down

0 comments on commit 93c1eaf

Please sign in to comment.