mirror of
https://github.com/fatedier/frp.git
synced 2026-03-25 10:01:45 +08:00
frps/control rename authTimeout; add judgement for subdomain
This commit is contained in:
@@ -45,7 +45,7 @@ var (
|
||||
LogMaxDays int64 = 3
|
||||
PrivilegeMode bool = false
|
||||
PrivilegeToken string = ""
|
||||
CtrlConnTimeout int64 = 10
|
||||
AuthTimeout int64 = 15
|
||||
Domain string = ""
|
||||
|
||||
// if PrivilegeAllowPorts is not nil, tcp proxies which remote port exist in this map can be connected
|
||||
@@ -224,13 +224,13 @@ func loadCommonConf(confFile string) error {
|
||||
MaxPoolCount = v
|
||||
}
|
||||
}
|
||||
tmpStr, ok = conf.Get("common", "conn_timeout")
|
||||
tmpStr, ok = conf.Get("common", "authentication_timeout")
|
||||
if ok {
|
||||
v, err := strconv.ParseInt(tmpStr, 10, 64)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Parse conf error: conn_timeout is incorrect")
|
||||
return fmt.Errorf("Parse conf error: authentication_timeout is incorrect")
|
||||
} else {
|
||||
CtrlConnTimeout = v
|
||||
AuthTimeout = v
|
||||
}
|
||||
}
|
||||
Domain, ok = conf.Get("common", "domain")
|
||||
|
||||
@@ -130,11 +130,13 @@ func (p *ProxyServer) Start(c *conn.Conn) (err error) {
|
||||
}
|
||||
p.listeners = append(p.listeners, l)
|
||||
}
|
||||
l, err := VhostHttpMuxer.Listen(p.SubDomain, p.HostHeaderRewrite, p.HttpUserName, p.HttpPassWord)
|
||||
if err != nil {
|
||||
return err
|
||||
if p.SubDomain != "" {
|
||||
l, err := VhostHttpMuxer.Listen(p.SubDomain, p.HostHeaderRewrite, p.HttpUserName, p.HttpPassWord)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
p.listeners = append(p.listeners, l)
|
||||
}
|
||||
p.listeners = append(p.listeners, l)
|
||||
|
||||
} else if p.Type == "https" {
|
||||
for _, domain := range p.CustomDomains {
|
||||
|
||||
Reference in New Issue
Block a user