mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[GH-ISSUE #3678] [Feature Request] 提高visitors的拓展性和灵活性 #2926
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#2926
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 @xcanwin on GitHub (Oct 14, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3678
Describe the feature request
首先,感谢作者创造这么好的一个作品。
user参数是一个好东西,可以减少很多重复关键词。
但是它也作用于visitors配置的serverName导致以下场景会报错:
电脑A的frpc服务端配置frpc.toml:
user = "hiA"
proxies
name = "ssh.secret"
type = "stcp"
localIP = "127.0.0.1"
localPort = 22
secretKey = "key"
allowUsers = ["*"]
然后电脑B的frpc访问端配置frpc.toml:
user = "hiB"
visitors
name = "hiA.ssh.secret.vistor"
type = "stcp"
serverName = "hiA.ssh.secret"
secretKey = "key"
bindAddr = "127.0.0.1"
bindPort = 2222
B访问A时报错:
2023/10/14 23:02:58 [W] [stcp.go:114] [64c917bedc65aa77] [hiB.hiA.ssh.secret.vistor] start new visitor connection error: custom listener for [hiB.hiA.ssh.secret] doesn't exist
如果serverName可以在有user参数时不自动添加{user}.的前缀,则上面的配置是不会有问题的。
Describe alternatives you've considered
以下解决方案可以解决问题,还能提高拓展性和灵活性。
建议visitors配置新增一个参数serverNamePrefix,默认值true,为true时为serverName前缀会自动添加{user}.,为false时保持不变。
谢谢。
Affected area
@xqzr commented on GitHub (Oct 14, 2023):
a7ad967231/conf/frpc.toml (L347)@xcanwin commented on GitHub (Oct 15, 2023):
谢谢,确实有用。