mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[PR #5120] [CLOSED] feat: Add ProxyStarted webhook event for dynamic port notification #5137
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#5137
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fatedier/frp/pull/5120
Author: @sripriya3191
Created: 1/9/2026
Status: ❌ Closed
Base:
dev← Head:feature/proxy-started-webhook📝 Commits (1)
3260d91feat: add ProxyStarted webhook event with allocated port📊 Changes
6 files changed (+101 additions, -19 deletions)
View changed files
📝
doc/server_plugin.md(+23 -1)📝
pkg/config/v1/validation/validation.go(+1 -0)📝
pkg/plugin/server/manager.go(+45 -12)📝
pkg/plugin/server/plugin.go(+7 -6)📝
pkg/plugin/server/types.go(+10 -0)📝
server/control.go(+15 -0)📄 Description
Summary
Add a new
ProxyStartedserver plugin webhook event that fires after a proxy has been successfully started and port allocation is complete.Problem
The existing
NewProxywebhook event fires before port allocation occurs. This means:remotePort = 0for dynamic port allocation, the webhook only receivesremote_port: 0NewUserConnevents to discover the negotiated portSolution
Add a new
ProxyStartedwebhook event that:remote_addrwith the actual allocated port (e.g.,:10000)CloseProxyfor consistencyUse Cases
Changes
pkg/plugin/server/types.go- AddProxyStartedContenttypepkg/plugin/server/plugin.go- AddOpProxyStartedconstantpkg/plugin/server/manager.go- AddproxyStartedPluginsslice andProxyStarted()methodpkg/config/v1/validation/validation.go- AddProxyStartedtoSupportedHTTPPluginOpsserver/control.go- CallProxyStartedwebhook after successful proxy registrationdoc/server_plugin.md- Update documentationConfiguration
Webhook Payload
Comparison: NewProxy vs ProxyStarted
remote_port/remote_addrNewProxyProxyStartedBackward Compatibility
This is a purely additive change:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.