mirror of
https://github.com/fatedier/frp.git
synced 2026-03-24 00:48:31 +08:00
support multilevel subdomain, fix #1132
This commit is contained in:
@@ -102,17 +102,24 @@ func (v *VhostMuxer) getListener(name, path string) (l *Listener, exist bool) {
|
||||
|
||||
domainSplit := strings.Split(name, ".")
|
||||
if len(domainSplit) < 3 {
|
||||
return l, false
|
||||
}
|
||||
domainSplit[0] = "*"
|
||||
name = strings.Join(domainSplit, ".")
|
||||
|
||||
vr, found = v.registryRouter.Get(name, path)
|
||||
if !found {
|
||||
return
|
||||
}
|
||||
|
||||
return vr.payload.(*Listener), true
|
||||
for {
|
||||
if len(domainSplit) < 3 {
|
||||
return
|
||||
}
|
||||
|
||||
domainSplit[0] = "*"
|
||||
name = strings.Join(domainSplit, ".")
|
||||
|
||||
vr, found = v.registryRouter.Get(name, path)
|
||||
if found {
|
||||
return vr.payload.(*Listener), true
|
||||
}
|
||||
domainSplit = domainSplit[1:]
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (v *VhostMuxer) run() {
|
||||
|
||||
Reference in New Issue
Block a user