mirror of
https://github.com/fatedier/frp.git
synced 2025-07-27 07:35:07 +00:00
new feature: load balancing for tcp proxy
This commit is contained in:
@@ -52,16 +52,13 @@ func (r *VhostRouters) Del(domain, location string) {
|
||||
if !found {
|
||||
return
|
||||
}
|
||||
|
||||
for i, vr := range vrs {
|
||||
if vr.location == location {
|
||||
if len(vrs) > i+1 {
|
||||
r.RouterByDomain[domain] = append(vrs[:i], vrs[i+1:]...)
|
||||
} else {
|
||||
r.RouterByDomain[domain] = vrs[:i]
|
||||
}
|
||||
newVrs := make([]*VhostRouter, 0)
|
||||
for _, vr := range vrs {
|
||||
if vr.location != location {
|
||||
newVrs = append(newVrs, vr)
|
||||
}
|
||||
}
|
||||
r.RouterByDomain[domain] = newVrs
|
||||
}
|
||||
|
||||
func (r *VhostRouters) Get(host, path string) (vr *VhostRouter, exist bool) {
|
||||
|
Reference in New Issue
Block a user