[GH-ISSUE #3232] NewProxy类型插件未上报自动生成的remote_port #2595

Closed
opened 2026-05-05 13:40:21 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @zhangboqi on GitHub (Dec 30, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/3232

Bug Description

当frpc代理配置remote_port=0时,即意味着由frps自动分配端口,在这种情况下NewProxy类型插件却未上报remote_port值

frpc Version

0.46.0

frps Version

0.46.0

System Architecture

linux/amd64

Configurations

frpc.ini

[common]
server_addr = 127.0.0.1
server_port = 7000
user=sn000001
[eppbox]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 0
meta_key=aaa

frps.ini

[common]
bind_port = 7000

[plugin.epp-notify]
addr = 127.0.0.1:8081
path = /handler
ops = NewProxy,CloseProxy,NewWorkConn,NewUserConn

Logs

这是插件收到的消息体:

{
"version":"0.1.0",
"op":"NewProxy",
"content":{
"user":{"user":"sn000001","metas":null,"run_id":"03fd2277703bcb59"},
"proxy_name":"sn000001.eppbox",
"proxy_type":"tcp",
"metas":{"key":"aaa"}
}
}

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 @zhangboqi on GitHub (Dec 30, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/3232 ### Bug Description 当frpc代理配置remote_port=0时,即意味着由frps自动分配端口,在这种情况下NewProxy类型插件却未上报remote_port值 ### frpc Version 0.46.0 ### frps Version 0.46.0 ### System Architecture linux/amd64 ### Configurations **frpc.ini** ``` [common] server_addr = 127.0.0.1 server_port = 7000 user=sn000001 [eppbox] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = 0 meta_key=aaa ``` **frps.ini** ``` [common] bind_port = 7000 [plugin.epp-notify] addr = 127.0.0.1:8081 path = /handler ops = NewProxy,CloseProxy,NewWorkConn,NewUserConn ``` ### Logs **这是插件收到的消息体:** ``` { "version":"0.1.0", "op":"NewProxy", "content":{ "user":{"user":"sn000001","metas":null,"run_id":"03fd2277703bcb59"}, "proxy_name":"sn000001.eppbox", "proxy_type":"tcp", "metas":{"key":"aaa"} } } ``` ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [X] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:40:21 -06:00
Author
Owner

@zhangboqi commented on GitHub (Dec 30, 2022):

不知道这个应该是bug,还是特性
但是希望能提供此类支持

<!-- gh-comment-id:1367791920 --> @zhangboqi commented on GitHub (Dec 30, 2022): 不知道这个应该是bug,还是特性 但是希望能提供此类支持
Author
Owner

@fatedier commented on GitHub (Dec 30, 2022):

只有当 NewProxy 消息处理成功之后,才会去监听端口,才能明确监听在哪个端口。
如果需要知道 proxy 监听的端口,可以通过 api 接口去获取。

<!-- gh-comment-id:1367794620 --> @fatedier commented on GitHub (Dec 30, 2022): 只有当 NewProxy 消息处理成功之后,才会去监听端口,才能明确监听在哪个端口。 如果需要知道 proxy 监听的端口,可以通过 api 接口去获取。
Author
Owner

@zhangboqi commented on GitHub (Dec 30, 2022):

明白了。我理解的有问题了。

<!-- gh-comment-id:1367795456 --> @zhangboqi commented on GitHub (Dec 30, 2022): 明白了。我理解的有问题了。
Author
Owner

@zhangboqi commented on GitHub (Dec 30, 2022):

我并未在官方文档中查找到frps api服务的相关文档,可否提供下相关文档说明地址?

<!-- gh-comment-id:1367796485 --> @zhangboqi commented on GitHub (Dec 30, 2022): 我并未在官方文档中查找到frps api服务的相关文档,可否提供下相关文档说明地址?
Author
Owner

@fatedier commented on GitHub (Dec 30, 2022):

https://github.com/fatedier/frp/blob/dev/server/dashboard_api.go
原来是给前端用的,没有明确暴露出来,直接看代码吧

<!-- gh-comment-id:1367797998 --> @fatedier commented on GitHub (Dec 30, 2022): https://github.com/fatedier/frp/blob/dev/server/dashboard_api.go 原来是给前端用的,没有明确暴露出来,直接看代码吧
Author
Owner

@zhangboqi commented on GitHub (Dec 30, 2022):

哈哈。可以

<!-- gh-comment-id:1367798708 --> @zhangboqi commented on GitHub (Dec 30, 2022): 哈哈。可以
Author
Owner

@github-actions[bot] commented on GitHub (Jan 30, 2023):

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

<!-- gh-comment-id:1407823345 --> @github-actions[bot] commented on GitHub (Jan 30, 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#2595
No description provided.