[GH-ISSUE #3411] [Feature Request] provide remote port at random #2728

Closed
opened 2026-05-05 13:45:30 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @mlhess on GitHub (Apr 15, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3411

Describe the feature request

This tool is awesome. We are using it for tcp forwarding. In the documented configuration, the client determines the port on the server. Is there a way to have the server provide a random port to the client that would change? This would have to be returned in some format that is parseable.

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @mlhess on GitHub (Apr 15, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3411 ### Describe the feature request This tool is awesome. We are using it for tcp forwarding. In the documented configuration, the client determines the port on the server. Is there a way to have the server provide a random port to the client that would change? This would have to be returned in some format that is parseable. ### Describe alternatives you've considered _No response_ ### Affected area - [ ] Docs - [X] Installation - [X] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [X] Client Plugin - [X] Server Plugin - [X] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:45:30 -06:00
Author
Owner

@mlhess commented on GitHub (Apr 15, 2023):

It looks like

remote_port = 0

Would solve this problem but on the client I don't get a port number assigned and on the server

2023/04/15 13:37:52 [I] [tcp.go:66] [6db8faca558c3248] [sql] tcp proxy listen port [0]
2023/04/15 13:37:52 [I] [control.go:464] [6db8faca558c3248] new proxy [sql] type [tcp] success

It looks like it is trying to bind to 0

<!-- gh-comment-id:1509833773 --> @mlhess commented on GitHub (Apr 15, 2023): It looks like ```# if remote_port is 0, frps will assign a random port for you remote_port = 0 ``` Would solve this problem but on the client I don't get a port number assigned and on the server ``` 2023/04/15 13:37:52 [I] [tcp.go:66] [6db8faca558c3248] [sql] tcp proxy listen port [0] 2023/04/15 13:37:52 [I] [control.go:464] [6db8faca558c3248] new proxy [sql] type [tcp] success ``` It looks like it is trying to bind to 0
Author
Owner

@fatedier commented on GitHub (Apr 15, 2023):

You can find the port on client/server dashboard or use api to query.

<!-- gh-comment-id:1509843743 --> @fatedier commented on GitHub (Apr 15, 2023): You can find the port on client/server dashboard or use api to query.
Author
Owner

@mlhess commented on GitHub (Apr 15, 2023):

I just found the port on the dashboard. Is there a way to get the client to spit it out in a manner that I could parse it?

<!-- gh-comment-id:1509843901 --> @mlhess commented on GitHub (Apr 15, 2023): I just found the port on the dashboard. Is there a way to get the client to spit it out in a manner that I could parse it?
Author
Owner

@github-actions[bot] commented on GitHub (May 16, 2023):

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

<!-- gh-comment-id:1548797751 --> @github-actions[bot] commented on GitHub (May 16, 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#2728
No description provided.