mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-09 14:47:47 +02:00
Restructured proxy routing logic
- Moved virtual directory into host routing object - Generalized root and hosts routing struct - Optimized UI
This commit is contained in:
@@ -119,11 +119,10 @@ func UpdateUptimeMonitorTargets() {
|
||||
|
||||
// Generate uptime monitor targets from reverse proxy rules
|
||||
func GetUptimeTargetsFromReverseProxyRules(dp *dynamicproxy.Router) []*uptime.Target {
|
||||
subds := dp.GetSDProxyEndpointsAsMap()
|
||||
vdirs := dp.GetVDProxyEndpointsAsMap()
|
||||
hosts := dp.GetProxyEndpointsAsMap()
|
||||
|
||||
UptimeTargets := []*uptime.Target{}
|
||||
for subd, target := range subds {
|
||||
for subd, target := range hosts {
|
||||
url := "http://" + target.Domain
|
||||
protocol := "http"
|
||||
if target.RequireTLS {
|
||||
@@ -139,21 +138,6 @@ func GetUptimeTargetsFromReverseProxyRules(dp *dynamicproxy.Router) []*uptime.Ta
|
||||
})
|
||||
}
|
||||
|
||||
for vdir, target := range vdirs {
|
||||
url := "http://" + target.Domain
|
||||
protocol := "http"
|
||||
if target.RequireTLS {
|
||||
url = "https://" + target.Domain
|
||||
protocol = "https"
|
||||
}
|
||||
UptimeTargets = append(UptimeTargets, &uptime.Target{
|
||||
ID: vdir,
|
||||
Name: "*" + vdir,
|
||||
URL: url,
|
||||
Protocol: protocol,
|
||||
})
|
||||
}
|
||||
|
||||
return UptimeTargets
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user