mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #4298] 支持不同ip的用户使用相同的 frp 配置名字 #3392
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#3392
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?
Originally created by @snail2sky on GitHub (Jun 24, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4298
Describe the feature request
只有一个公网IP
需要通过这个公网IP 来暴露多个内网设备,有可能是ssh服务或者web服务
要进行代理的服务无法都使用 name=ssh 或者name=web
猜测frp内部只用name作为hash的key,由于这一个公网ip可能给多个租户使用,他们之间可能会暴露相同的服务,导致服务名很有可能会相同
希望能加上一个功能,使用 name+客户端ip进行hash,这样的话,就可以允许 不同ip的用户 可以使用相同的名字创建自己的代理服务了
端口肯定没办法复用,这个没有办法~
但是配置文件种的名字应该是可以的
Describe alternatives you've considered
frp-client 连接 frp-server时,以name+ip作为map的key
frp-client 断开连接时,按照之前的逻辑移除即可
当然用ip不一定是最优解,因为很有可能在同一个局域网中有多个需要暴露的内网设备,那么这些设备的出口ip可能是一样的
因此,可以给每个frpc实例增加一个唯一标识可能会更好,如果用户没写,则自动生成一个随机的也行,反正 最终会使用 端口进行访问,只要能把这个配置写入到 frps 中即可,单一用名字进行hash,冲突的可能性很大
Affected area
@wuai1024 commented on GitHub (Jun 24, 2024):
不用这么麻烦,现在就支持的。
通过添加
user标记不同用户,proxy 中的 name 就可以重复了@snail2sky commented on GitHub (Jun 24, 2024):
对对对 就是这个需求
@waxi-i commented on GitHub (Oct 19, 2024):
这个user可以自动生成吗,因为想客户端自动注册
@fatedier commented on GitHub (Oct 21, 2024):
可以结合环境变量模版使用,随机生成一个特定的环境变量,然后在配置模版中引用这个变量。
@snail2sky commented on GitHub (Oct 23, 2024):
高版本 已经支持了 通过user配置,issue 已关闭