frps/control rename authTimeout; add judgement for subdomain

This commit is contained in:
Maodanping
2016-11-08 13:40:40 +08:00
parent 7cc5d03f35
commit c702355669
4 changed files with 22 additions and 14 deletions

View File

@@ -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")

View File

@@ -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 {