mirror of
https://github.com/fatedier/frp.git
synced 2026-03-25 10:01:45 +08:00
update conf
This commit is contained in:
@@ -34,6 +34,7 @@ type ServerMetric struct {
|
||||
BindAddr string `json:"bind_addr"`
|
||||
ListenPort int64 `json:"listen_port"`
|
||||
CustomDomains []string `json:"custom_domains"`
|
||||
Locations []string `json:"locations"`
|
||||
Status string `json:"status"`
|
||||
UseEncryption bool `json:"use_encryption"`
|
||||
UseGzip bool `json:"use_gzip"`
|
||||
@@ -112,7 +113,7 @@ func GetProxyMetrics(proxyName string) *ServerMetric {
|
||||
|
||||
func SetProxyInfo(proxyName string, proxyType, bindAddr string,
|
||||
useEncryption, useGzip, privilegeMode bool, customDomains []string,
|
||||
listenPort int64) {
|
||||
locations []string, listenPort int64) {
|
||||
smMutex.Lock()
|
||||
info, ok := ServerMetricInfoMap[proxyName]
|
||||
if !ok {
|
||||
@@ -127,6 +128,7 @@ func SetProxyInfo(proxyName string, proxyType, bindAddr string,
|
||||
info.BindAddr = bindAddr
|
||||
info.ListenPort = listenPort
|
||||
info.CustomDomains = customDomains
|
||||
info.Locations = locations
|
||||
ServerMetricInfoMap[proxyName] = info
|
||||
smMutex.Unlock()
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ 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)
|
||||
p.PrivilegeMode, p.CustomDomains, p.Locations, p.ListenPort)
|
||||
}
|
||||
return proxyServers, nil
|
||||
}
|
||||
@@ -402,7 +402,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)
|
||||
s.PrivilegeMode, s.CustomDomains, s.Locations, s.ListenPort)
|
||||
s.Init()
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user