[GH-ISSUE #3302] xtcp模式不能跨user匹配p2p服务 #2643

Closed
opened 2026-05-05 13:42:17 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @Cp0204 on GitHub (Feb 11, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3302

Bug Description

背景:平时我用 [common]user 字段以区分不同设备端,避免服务名冲突(表现为user.server);当使用xtcp时,访问端server_name也会加上访问端的user,导致不能相互匹配。

设备A:
[common]
user = AAA
[p2p_ssh]
此时服务名为:AAA.p2p_ssh

设备B:
[common]
user = BBB
[p2p_ssh_visitor]
server_name = p2p_ssh

将报错:[BBB.p2p_ssh_visitor] natHoleRespMsg get error info: xtcp server for [BBB.p2p_ssh] doesn't exist

期望 server_name = AAA.p2p_ssh 可以匹配上,而目前会自动变成 BBB.AAA.p2p_ssh,同样doesn't exist

frpc Version

0.46.1

frps Version

0.46.1

System Architecture

linux/amd64

Configurations

  1. 在需要暴露到外网的机器上部署 frpc,且配置如下:
[common]
server_addr = x.x.x.x
server_port = 7000
user=AAA

[p2p_ssh]
type = xtcp
# 只有 sk 一致的用户才能访问到此服务
sk = abcdefg
local_ip = 127.0.0.1
local_port = 22
  1. 在想要访问内网服务的机器上也部署 frpc,且配置如下:
[common]
server_addr = x.x.x.x
server_port = 7000
**user = BBB**

[p2p_ssh_visitor]
type = xtcp
# xtcp 的访问者
role = visitor
# 要访问的 xtcp 代理的名字
server_name = p2p_ssh
sk = abcdefg
# 绑定本地端口用于访问 ssh 服务
bind_addr = 127.0.0.1
bind_port = 6000

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @Cp0204 on GitHub (Feb 11, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3302 ### Bug Description 背景:平时我用 [common]user 字段以区分不同设备端,避免服务名冲突(表现为user.server);当使用xtcp时,访问端server_name也会加上访问端的user,导致不能相互匹配。 **设备A:** [common] user = AAA [p2p_ssh] 此时服务名为:AAA.p2p_ssh **设备B:** [common] user = BBB [p2p_ssh_visitor] server_name = p2p_ssh 将报错:[BBB.p2p_ssh_visitor] natHoleRespMsg get error info: xtcp server for [BBB.p2p_ssh] doesn't exist 期望 server_name = AAA.p2p_ssh 可以匹配上,而目前会自动变成 BBB.AAA.p2p_ssh,同样doesn't exist ### frpc Version 0.46.1 ### frps Version 0.46.1 ### System Architecture linux/amd64 ### Configurations 2. 在需要暴露到外网的机器上部署 frpc,且配置如下: ``` [common] server_addr = x.x.x.x server_port = 7000 user=AAA [p2p_ssh] type = xtcp # 只有 sk 一致的用户才能访问到此服务 sk = abcdefg local_ip = 127.0.0.1 local_port = 22 ``` 3. 在想要访问内网服务的机器上也部署 frpc,且配置如下: ``` [common] server_addr = x.x.x.x server_port = 7000 **user = BBB** [p2p_ssh_visitor] type = xtcp # xtcp 的访问者 role = visitor # 要访问的 xtcp 代理的名字 server_name = p2p_ssh sk = abcdefg # 绑定本地端口用于访问 ssh 服务 bind_addr = 127.0.0.1 bind_port = 6000 ``` ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:42:17 -06:00
Author
Owner

@Miaoerr commented on GitHub (Mar 2, 2023):

使用stcp 遇到同样的问题
作为visitor时,server_name是否应该不自动添加user前缀?

<!-- gh-comment-id:1451844015 --> @Miaoerr commented on GitHub (Mar 2, 2023): 使用stcp 遇到同样的问题 作为visitor时,server_name是否应该不自动添加user前缀?
Author
Owner

@github-actions[bot] commented on GitHub (Apr 2, 2023):

Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

<!-- gh-comment-id:1493183941 --> @github-actions[bot] commented on GitHub (Apr 2, 2023): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
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#2643
No description provided.