Skip to content

Commit

Permalink
update release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
fatedier committed May 28, 2023
1 parent 0dd5425 commit df6f812
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 13 deletions.
22 changes: 10 additions & 12 deletions content/zh-cn/docs/Examples/xtcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,16 @@ frp 提供了一种新的代理类型 `xtcp` 用于应对在希望传输大量

使用方式同 `stcp` 类似,需要在两边都部署上 frpc 用于建立直接的连接。

**目前处于开发的初级阶段,并不能穿透所有类型的 NAT 设备,所以穿透成功率较低。穿透失败时可以尝试 `stcp` 的方式。**
**XTCP 并不能穿透所有类型的 NAT 设备,穿透失败时可以尝试 `stcp` 的方式。**

1. frps.ini 内容如下,需要额外配置监听一个 UDP 端口用于支持该类型的客户端:

```ini
[common]
bind_port = 7000
bind_udp_port = 7000
```

2. 在需要暴露到外网的机器上部署 frpc,且配置如下:
1. 在需要暴露到外网的机器上部署 frpc,且配置如下:

```ini
[common]
server_addr = x.x.x.x
server_port = 7000
# 当默认的 stun server 不可用时,可以配置一个新的
# nat_hole_stun_server = xxx

[p2p_ssh]
type = xtcp
Expand All @@ -34,12 +28,14 @@ frp 提供了一种新的代理类型 `xtcp` 用于应对在希望传输大量
local_port = 22
```

3. 在想要访问内网服务的机器上也部署 frpc,且配置如下:
2. 在想要访问内网服务的机器上也部署 frpc,且配置如下:

```ini
[common]
server_addr = x.x.x.x
server_port = 7000
# 当默认的 stun server 不可用时,可以配置一个新的
# nat_hole_stun_server = xxx

[p2p_ssh_visitor]
type = xtcp
Expand All @@ -51,8 +47,10 @@ frp 提供了一种新的代理类型 `xtcp` 用于应对在希望传输大量
# 绑定本地端口用于访问 ssh 服务
bind_addr = 127.0.0.1
bind_port = 6000
# 当需要自动保持隧道打开时,设置为 true
# keep_tunnel_open = false
```

4. 通过 SSH 访问内网机器,假设用户名为 test:
3. 通过 SSH 访问内网机器,假设用户名为 test:

`ssh -oPort=6000 [email protected]`
6 changes: 5 additions & 1 deletion content/zh-cn/docs/Features/xtcp/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@ description: >

XTCP 的配置方式和 STCP 很类似。但是会采用 P2P 的方式进行打洞穿透,如果成功,后续的流量将不会经过 frps,而是直接通信,不再受到 frps 所在服务器的带宽限制。

由于打洞成功率较低,所以 XTCP 的可用性和稳定性无法保证。在需要可靠连接的情况下,建议使用 STCP 替代。
由于打洞成功率取决于所处网络的 NAT 类型,所以 XTCP 的可用性和稳定性无法保证。在需要可靠连接的情况下,建议使用 STCP 替代。

当 visitor 配置了 `keep_tunnel_open = true` 时,frpc 会定期检测隧道是否打开,如果没有,则会尝试打洞建立隧道,这样可以始终保持隧道打开,在需要连接对端服务时,可以避免延迟。

默认情况下,visitor 会在接收到用户连接后尝试打洞,如果打洞失败,可以尝试多次建立连接,程序会尝试其他的打洞策略,有可能在多次重试后成功打洞。一旦打洞成功,后续新增连接不必重复打洞,而是可以复用隧道。
1 change: 1 addition & 0 deletions content/zh-cn/docs/Reference/client-configures.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ description: >
| :--- | :--- | :--- | :--- | :--- | :---|
| server_addr | string | 连接服务端的地址 | 0.0.0.0 | | |
| server_port | int | 连接服务端的端口 | 7000 | | |
| nat_hole_stun_server | string | xtcp 打洞所需的 stun 服务器地址 | stun.easyvoip.com:3478 | | |
| connect_server_local_ip | string | 连接服务端时所绑定的本地 IP | | | |
| dial_server_timeout | int | 连接服务端的超时时间 | 10 | | |
| dial_server_keepalive | int | 和服务端底层 TCP 连接的 keepalive 间隔时间,单位秒 | 7200 | | 负数不启用 |
Expand Down
8 changes: 8 additions & 0 deletions content/zh-cn/docs/Reference/proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ description: >
| role | string | 角色 || server | server,visitor | server 表示服务端,visitor 表示访问端 |
| sk | string | 密钥 || | | 服务端和访问端的密钥需要一致,访问端才能访问到服务端 |

## XTCP visitor

| 参数 | 类型 | 说明 | 是否必须 | 默认值 | 可选值 | 备注 |
| :--- | :---: | :--- | :---: | :---: | :--- | :--- |
| keep_tunnel_open | bool | 是否保持隧道打开 || false | | 如果开启,会定期检查隧道状态并尝试保持打开 |
| max_retries_an_hour | int | 每小时尝试打开隧道的次数 || 8 | | 仅在 keep_tunnel_open 为 true 时有效 |
| min_retry_interval | int | 重试打开隧道的最小间隔时间,单位: 秒 || 90 | | 仅在 keep_tunnel_open 为 true 时有效 |

## TCPMUX

`custom_domains``subdomain` 必须要配置其中一个,两者可以同时生效。
Expand Down
1 change: 1 addition & 0 deletions content/zh-cn/docs/Reference/server-configures.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ description: >
| tls_cert_file | string | TLS 服务端证书文件路径 | | | |
| tls_key_file | string | TLS 服务端密钥文件路径 | | | |
| tls_trusted_ca_file | string | TLS CA 证书路径 | | | |
| nat_hole_analysis_data_reserve_hours | int | 打洞策略数据的保留时间 | 168 | | |

## 权限验证

Expand Down
7 changes: 7 additions & 0 deletions content/zh-cn/release/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ cascade:
- type: "docs"
---

#### v0.49.0

* [new] frpc 新增 nathole discover 命令用于测试当前网络的 NAT 类型。
* [new] xtcp 重构,大幅提高穿透成功率。(和之前的版本不兼容)
* [new] 校验密码时使用 subtle.ConstantTimeCompare ,密码不正确时引入一定的延迟。
* [fix] 修复 frps dashboard 打开多个 table 条目卡顿的问题。

#### v0.48.0

* [New] `tcpmux``httpconnect` 类型支持通过 `http_user``http_pwd` 参数启用身份验证。
Expand Down

0 comments on commit df6f812

Please sign in to comment.