[GH-ISSUE #1263] 能否支持自动remote配置端口? #1000

Closed
opened 2026-05-05 12:38:40 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @nkbai on GitHub (May 28, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1263

就像DHCP类似的工作原理
frpc.ini中

[ssh-meshboxcq]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = auto
  1. remote_port配置为auto
    2.然后frps指定一段可用的端口,
  2. frpc 向服务器请求的时候带上一个可以指定的id信息
  3. 通过frps 对外暴露的服务查询,分配了哪些端口
  4. frps可以根据配置文件建立静态绑定关系
Originally created by @nkbai on GitHub (May 28, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1263 就像DHCP类似的工作原理 frpc.ini中 ``` [ssh-meshboxcq] type = tcp local_ip = 127.0.0.1 local_port = 22 remote_port = auto ``` 1. remote_port配置为auto 2.然后frps指定一段可用的端口, 3. frpc 向服务器请求的时候带上一个可以指定的id信息 4. 通过frps 对外暴露的服务查询,分配了哪些端口 5. frps可以根据配置文件建立静态绑定关系
Author
Owner

@status301 commented on GitHub (May 30, 2019):

@nkbai 使用前请看文档
https://github.com/fatedier/frp/blob/master/README_zh.md
https://github.com/fatedier/frp/blob/master/conf/frpc_full.ini

[ssh_random]
type = tcp
local_ip = 127.0.0.1
local_port = 22
# if remote_port is 0, frps will assign a random port for you
remote_port = 0
<!-- gh-comment-id:497194107 --> @status301 commented on GitHub (May 30, 2019): @nkbai 使用前请看文档 https://github.com/fatedier/frp/blob/master/README_zh.md https://github.com/fatedier/frp/blob/master/conf/frpc_full.ini ``` [ssh_random] type = tcp local_ip = 127.0.0.1 local_port = 22 # if remote_port is 0, frps will assign a random port for you remote_port = 0 ```
Author
Owner

@nkbai commented on GitHub (May 31, 2019):

非常感谢,方案完美! @status301

<!-- gh-comment-id:497586776 --> @nkbai commented on GitHub (May 31, 2019): 非常感谢,方案完美! @status301
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#1000
No description provided.