Skip to content

Commit a56f068

Browse files
committed
subdomain: fix a bug that subdomain is not correct for https, close fatedier#194
1 parent 6a6ccc5 commit a56f068

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/models/client/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ func LoadConf(confFile string) (err error) {
166166
if ok {
167167
proxyClient.HttpPassWord = tmpStr
168168
}
169+
170+
}
171+
if proxyClient.Type == "http" || proxyClient.Type == "https" {
169172
// subdomain
170173
tmpStr, ok = section["subdomain"]
171174
if ok {

src/models/server/server.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ func (p *ProxyServer) Start(c *conn.Conn) (err error) {
184184
}
185185
p.listeners = append(p.listeners, l)
186186
}
187+
if p.SubDomain != "" {
188+
l, err := VhostHttpsMuxer.Listen(p.SubDomain, "", p.HostHeaderRewrite, p.HttpUserName, p.HttpPassWord)
189+
if err != nil {
190+
return err
191+
}
192+
p.listeners = append(p.listeners, l)
193+
}
187194
}
188195

189196
p.Lock()

0 commit comments

Comments
 (0)