subdomain: fix a bug that subdomain is not correct for https, close #194

This commit is contained in:
fatedier 2016-12-25 14:15:34 +08:00
parent 6a6ccc5302
commit a56f068f8c
2 changed files with 10 additions and 0 deletions

View File

@ -166,6 +166,9 @@ func LoadConf(confFile string) (err error) {
if ok { if ok {
proxyClient.HttpPassWord = tmpStr proxyClient.HttpPassWord = tmpStr
} }
}
if proxyClient.Type == "http" || proxyClient.Type == "https" {
// subdomain // subdomain
tmpStr, ok = section["subdomain"] tmpStr, ok = section["subdomain"]
if ok { if ok {

View File

@ -184,6 +184,13 @@ func (p *ProxyServer) Start(c *conn.Conn) (err error) {
} }
p.listeners = append(p.listeners, l) p.listeners = append(p.listeners, l)
} }
if p.SubDomain != "" {
l, err := VhostHttpsMuxer.Listen(p.SubDomain, "", p.HostHeaderRewrite, p.HttpUserName, p.HttpPassWord)
if err != nil {
return err
}
p.listeners = append(p.listeners, l)
}
} }
p.Lock() p.Lock()