Add KCP support

This commit is contained in:
KernelErr
2021-10-26 21:36:12 +08:00
parent 4c9b7a6990
commit 55eef8581c
12 changed files with 404 additions and 143 deletions

View File

@@ -6,12 +6,13 @@
[English](/README-EN.md)
Fourth是一个Rust实现的Layer 4代理用于监听指定端口TCP流量并根据规则转发到指定目标。
Fourth是一个Rust实现的Layer 4代理用于监听指定端口TCP/KCP流量,并根据规则转发到指定目标目前只支持TCP
## 功能
- 监听指定端口代理到本地或远端指定端口
- 监听指定端口通过TLS ClientHello消息中的SNI进行分流
- 支持KCP入站
## 安装方法
@@ -37,20 +38,25 @@ servers:
listen:
- "0.0.0.0:443"
- "[::]:443"
tls: true # 启动SNI分流将根据TLS请求中的主机名分流
tls: true # Enable TLS features like SNI filtering
sni:
proxy.example.com: proxy
www.example.com: nginx
default: ban
relay_server:
proxy_server:
listen:
- "127.0.0.1:8081"
default: remote
kcp_server:
protocol: kcp # default TCP
listen:
- "127.0.0.1:8082"
default: echo
upstream:
nginx: "127.0.0.1:8080"
proxy: "127.0.0.1:1024"
other: "www.remote.example.com:8082" # 代理到远端地址
other: "www.remote.example.com:8082" # proxy to remote address
```
内置两个的upstreamban立即中断连接、echo返回读到的数据