mirror of
https://github.com/fatedier/frp.git
synced 2026-04-01 06:39:15 +08:00
support the configure of url in "http" section
This commit is contained in:
@@ -296,6 +296,12 @@ func loadProxyConf(confFile string) (proxyServers map[string]*ProxyServer, err e
|
||||
} else {
|
||||
return proxyServers, fmt.Errorf("Parse conf error: proxy [%s] custom_domains must be set when type equals http", proxyServer.Name)
|
||||
}
|
||||
|
||||
//location
|
||||
locStr, loc_ok := section["custom_location"]
|
||||
if loc_ok {
|
||||
proxyServer.Locations = strings.Split(locStr, ",")
|
||||
}
|
||||
} else if proxyServer.Type == "https" {
|
||||
// for https
|
||||
proxyServer.ListenPort = VhostHttpsPort
|
||||
@@ -318,9 +324,8 @@ func loadProxyConf(confFile string) (proxyServers map[string]*ProxyServer, err e
|
||||
}
|
||||
|
||||
// set metric statistics of all proxies
|
||||
for name, p := range proxyServers {
|
||||
metric.SetProxyInfo(name, p.Type, p.BindAddr, p.UseEncryption, p.UseGzip,
|
||||
p.PrivilegeMode, p.CustomDomains, p.ListenPort)
|
||||
for _, p := range proxyServers {
|
||||
metric.SetProxyInfo(*p.ProxyServerConf)
|
||||
}
|
||||
return proxyServers, nil
|
||||
}
|
||||
@@ -381,8 +386,7 @@ func CreateProxy(s *ProxyServer) error {
|
||||
}
|
||||
}
|
||||
ProxyServers[s.Name] = s
|
||||
metric.SetProxyInfo(s.Name, s.Type, s.BindAddr, s.UseEncryption, s.UseGzip,
|
||||
s.PrivilegeMode, s.CustomDomains, s.ListenPort)
|
||||
metric.SetProxyInfo(*s.ProxyServerConf)
|
||||
s.Init()
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user