Add NewVisitorConn operation to server plugin system#5277
Open
jareddarkweb wants to merge 3 commits intofatedier:devfrom
Open
Add NewVisitorConn operation to server plugin system#5277jareddarkweb wants to merge 3 commits intofatedier:devfrom
jareddarkweb wants to merge 3 commits intofatedier:devfrom
Conversation
added 3 commits
April 3, 2026 15:09
- Add OpNewVisitorConn constant to support visitor connection callbacks - Add NewVisitorConnContent struct for plugin payload - Implement plugin manager handler for visitor connections - Integrate plugin hook in RegisterVisitorConn method Closes fatedier#5273
| RunID: newMsg.RunID, | ||
| }, | ||
| ProxyName: newMsg.ProxyName, | ||
| ProxyType: "stcp", // Default type, could be determined from proxy config |
There was a problem hiding this comment.
WARNING: ProxyType is hard-coded to "stcp", so sudp visitor connections will be reported to plugins as the wrong protocol. Any plugin that branches on proxy_type will mis-handle or reject every sudp connection even though this hook is documented for both visitor-based proxy types.
Code Review SummaryStatus: 1 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)No additional issues found outside the diff. Files Reviewed (6 files)
Fix these issues in Kilo Cloud Reviewed by gpt-5.4-20260305 · 227,761 tokens |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature
Support NewVisitorConn operation in server plugin callbacks to enable pre-connection logic for STCP/SUDP proxies.
Motivation
Fixes #5273
When using stcp proxies, users may need to trigger pre-connection actions (e.g., Wake-on-LAN) before a visitor connects. Currently, there's no plugin hook for visitor connections.
Changes
OpNewVisitorConnconstant to plugin operationsNewVisitorConnContentstruct for plugin payloadsRegisterVisitorConnmethodTesting
Example Usage
The plugin will receive notifications when a visitor attempts to connect to an stcp proxy, allowing pre-connection logic like Wake-on-LAN.
Make sure:
fatedier/frp/devbranchjareddarkweb/frp/feature/newvisitorconn-pluginbranch