[GH-ISSUE #3510] 使用xtcp时,启用use_compression会导致连接出问题? #2805

Closed
opened 2026-05-05 13:48:43 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @zlm324 on GitHub (Jun 30, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3510

Bug Description

两台机器配置文件见下文,在B机器上启动frpc.exe后,提示“[ServiceA-xtcp-visitor] establishing nat hole connection successful”,但使用RDP连接A机器会提示“无法连接,错误代码0x907,补充代码0x7”。

在A机器配置文件的[ServiceA-xtcp]段将"use_compression = true“一行删掉,故障解除。

此外,如果单使用stcp,即使使用”use_compression = true“,功能也正常。

不清楚这是我使用不当还是bug,请诸位指教,感谢。

frpc Version

0.50.0

frps Version

0.50.0

System Architecture

windows/amd64

Configurations

A机器:
Windows 11,22631
[ServiceA-stcp]
type = stcp
sk = <>
local_ip = 127.0.0.1
local_port = 3389
use_compression = true

[SeviceA-xtcp]
type = xtcp
sk = <>
local_ip = 127.0.0.1
local_port = 3389
use_compression = true

B机器:
Windows 11,22621
[ServiceA-stcp-visitor]
type = stcp
role = visitor
server_name = ServiceA-stcp
bind_port = -1

[ServiceA-xtcp-visitor]
type = xtcp
role = visitor
server_name = ServiceA-xtcp
bind_addr = 127.0.0.1
bind_port = 3390
fallback_to = ServiceA-stcp-visitor
fallback_timeout_ms = 2000
keep_tunnel_open = true

Logs

No response

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @zlm324 on GitHub (Jun 30, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3510 ### Bug Description 两台机器配置文件见下文,在B机器上启动frpc.exe后,提示“[ServiceA-xtcp-visitor] establishing nat hole connection successful”,但使用RDP连接A机器会提示“无法连接,错误代码0x907,补充代码0x7”。 在A机器配置文件的[ServiceA-xtcp]段将"use_compression = true“一行删掉,故障解除。 此外,如果单使用stcp,即使使用”use_compression = true“,功能也正常。 不清楚这是我使用不当还是bug,请诸位指教,感谢。 ### frpc Version 0.50.0 ### frps Version 0.50.0 ### System Architecture windows/amd64 ### Configurations A机器: Windows 11,22631 [ServiceA-stcp] type = stcp sk = <> local_ip = 127.0.0.1 local_port = 3389 use_compression = true [SeviceA-xtcp] type = xtcp sk = <> local_ip = 127.0.0.1 local_port = 3389 use_compression = true B机器: Windows 11,22621 [ServiceA-stcp-visitor] type = stcp role = visitor server_name = ServiceA-stcp bind_port = -1 [ServiceA-xtcp-visitor] type = xtcp role = visitor server_name = ServiceA-xtcp bind_addr = 127.0.0.1 bind_port = 3390 fallback_to = ServiceA-stcp-visitor fallback_timeout_ms = 2000 keep_tunnel_open = true ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@zlm324 commented on GitHub (Jun 30, 2023):

我搞清楚了,use_compression = true,要求在A和B配置文件中同时存在,只一边有不行。

<!-- gh-comment-id:1614046336 --> @zlm324 commented on GitHub (Jun 30, 2023): 我搞清楚了,use_compression = true,要求在A和B配置文件中同时存在,只一边有不行。
Author
Owner

@zlm324 commented on GitHub (Jun 30, 2023):

我又测试了一下,stcp协议真的不需要双边加”use_compression = true",单边有就可以正常连接,至于加密功能是否生效我不清楚。所以在xtcp中必须双边配置,这算是个bug吗?

<!-- gh-comment-id:1614053283 --> @zlm324 commented on GitHub (Jun 30, 2023): 我又测试了一下,stcp协议真的不需要双边加”use_compression = true",单边有就可以正常连接,至于加密功能是否生效我不清楚。所以在xtcp中必须双边配置,这算是个bug吗?
Author
Owner

@fatedier commented on GitHub (Jun 30, 2023):

stcp 和 xtcp 的机制不一样,所以行为上会有一些不同。

stcp 是两个 frpc 都先连接 frps,加密和压缩都是 frpc 和 frps 之间的事情,是独立的,所以你的配置仅作用于单边的 frpc 和 frps。frpc 会事先把是否要加密和压缩通知 frps,所以 frps 能正确处理。

xtcp 是两个 frpc 直接通信,要压缩就需要两边都开启,不存在单边开启的情况。

use_encryption 通常不建议使用,因为现在默认会启用 TLS 加密,不需要再重复加密。

<!-- gh-comment-id:1614070423 --> @fatedier commented on GitHub (Jun 30, 2023): stcp 和 xtcp 的机制不一样,所以行为上会有一些不同。 stcp 是两个 frpc 都先连接 frps,加密和压缩都是 frpc 和 frps 之间的事情,是独立的,所以你的配置仅作用于单边的 frpc 和 frps。frpc 会事先把是否要加密和压缩通知 frps,所以 frps 能正确处理。 xtcp 是两个 frpc 直接通信,要压缩就需要两边都开启,不存在单边开启的情况。 `use_encryption` 通常不建议使用,因为现在默认会启用 TLS 加密,不需要再重复加密。
Author
Owner

@zlm324 commented on GitHub (Jun 30, 2023):

stcp 和 xtcp 的机制不一样,所以行为上会有一些不同。

stcp 是两个 frpc 都先连接 frps,加密和压缩都是 frpc 和 frps 之间的事情,是独立的,所以你的配置仅作用于单边的 frpc 和 frps。frpc 会事先把是否要加密和压缩通知 frps,所以 frps 能正确处理。

xtcp 是两个 frpc 直接通信,要压缩就需要两边都开启,不存在单边开启的情况。

use_encryption 通常不建议使用,因为现在默认会启用 TLS 加密,不需要再重复加密。

非常感谢!!

<!-- gh-comment-id:1614071392 --> @zlm324 commented on GitHub (Jun 30, 2023): > stcp 和 xtcp 的机制不一样,所以行为上会有一些不同。 > > stcp 是两个 frpc 都先连接 frps,加密和压缩都是 frpc 和 frps 之间的事情,是独立的,所以你的配置仅作用于单边的 frpc 和 frps。frpc 会事先把是否要加密和压缩通知 frps,所以 frps 能正确处理。 > > xtcp 是两个 frpc 直接通信,要压缩就需要两边都开启,不存在单边开启的情况。 > > `use_encryption` 通常不建议使用,因为现在默认会启用 TLS 加密,不需要再重复加密。 非常感谢!!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#2805
No description provided.