[GH-ISSUE #1731] [DISCUSS]Trace access IP and notify #1368

Closed
opened 2026-05-05 12:52:04 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @rainbend on GitHub (Apr 4, 2020).
Original GitHub issue: https://github.com/fatedier/frp/issues/1731

Motivation

Trace the source IP of the access proxy, and notify other software.

Modification

Result

Based on the above ideas and manager-plugin, I can quickly see who is accessing the proxy.

image

Originally created by @rainbend on GitHub (Apr 4, 2020). Original GitHub issue: https://github.com/fatedier/frp/issues/1731 ### Motivation Trace the source IP of the access proxy, and notify other software. ### Modification + Add [TraceAccessIp(pxyName string, userRemoteAddr string)](https://github.com/arugal/frp/blob/89d5f73c8c74f77bf4bac955fd12af96d52c47e4/models/plugin/server/manager.go#L125-L133) method to the server manage plugins, used to record the address of the access proxy + Call `TraceAccessIp` method in [HandleUserTcpConnection(pxy Proxy, userConn net.Conn, serverCfg config.ServerCommonConf)](https://github.com/arugal/frp/blob/89d5f73c8c74f77bf4bac955fd12af96d52c47e4/server/proxy/proxy.go#L252) + [Notify](https://github.com/arugal/frp/blob/89d5f73c8c74f77bf4bac955fd12af96d52c47e4/models/plugin/server/manager.go#L136-L160) other software ### Result Based on the above ideas and [manager-plugin](https://github.com/arugal/frp-manager), I can quickly see who is accessing the proxy. ![image](https://user-images.githubusercontent.com/26432832/78455215-8b900200-76cf-11ea-983e-d984f2e81d74.png)
gitea-mirror 2026-05-05 12:52:05 -06:00
  • closed this issue
  • added the
    todo
    label
Author
Owner

@fatedier commented on GitHub (Apr 5, 2020):

  1. We should define a new operation for this like NewUserConn.
  2. Define a content struct like other operations.
type NewUserConn struct {
    User UserInfo

    ProxyName string
    ProxyType string
    RemoteAddr string
}
  1. HandleUserTcpConnection maybe not suitable to inject plugin opeartion. Not all proxy type will call this function such as http, udp. We may need to refctor code If we want to implement this plugin in a graceful way.
<!-- gh-comment-id:609411171 --> @fatedier commented on GitHub (Apr 5, 2020): 1. We should define a new operation for this like `NewUserConn`. 2. Define a content struct like other operations. ```go type NewUserConn struct { User UserInfo ProxyName string ProxyType string RemoteAddr string } ``` 3. `HandleUserTcpConnection` maybe not suitable to inject plugin opeartion. Not all proxy type will call this function such as http, udp. We may need to refctor code If we want to implement this plugin in a graceful way.
Author
Owner

@rainbend commented on GitHub (Apr 5, 2020):

We may need to refctor code If we want to implement this plugin in a graceful way.

Hi @fatedier thank you for your quick reply. Do we need to discuss the details of refactoring through WeChat?

<!-- gh-comment-id:609417895 --> @rainbend commented on GitHub (Apr 5, 2020): > We may need to refctor code If we want to implement this plugin in a graceful way. Hi @fatedier thank you for your quick reply. Do we need to discuss the details of refactoring through WeChat?
Author
Owner

@fatedier commented on GitHub (Apr 5, 2020):

@arugal It's convenient for others to track the issue if we discuss here.

I consider that you can first implement this plugin API in your way and describe which proxy types it supports in document, since refactoring is a complex work and i will take much time to redesign it. WDYT?

<!-- gh-comment-id:609421742 --> @fatedier commented on GitHub (Apr 5, 2020): @arugal It's convenient for others to track the issue if we discuss here. I consider that you can first implement this plugin API in your way and describe which proxy types it supports in document, since refactoring is a complex work and i will take much time to redesign it. WDYT?
Author
Owner

@rainbend commented on GitHub (Apr 5, 2020):

@arugal It's convenient for others to track the issue if we discuss here.

Agreed

I consider that you can first implement this plugin API in your way and describe which proxy types it supports in document

I will initiate a PR based on the comments.

<!-- gh-comment-id:609423046 --> @rainbend commented on GitHub (Apr 5, 2020): > @arugal It's convenient for others to track the issue if we discuss here. Agreed > I consider that you can first implement this plugin API in your way and describe which proxy types it supports in document I will initiate a PR based on the comments.
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#1368
No description provided.