diff --git a/src/assets/static/index.html b/src/assets/static/index.html
index dc7f3626..d9170081 100644
--- a/src/assets/static/index.html
+++ b/src/assets/static/index.html
@@ -25,6 +25,7 @@
CurCon |
FlowOut |
FlowIn |
+ TotalAcceptConns |
@@ -34,10 +35,11 @@
|
|
- |
+ |
|
|
|
+ |
diff --git a/src/utils/vhost/vhost.go b/src/utils/vhost/vhost.go
index fb0b5c8f..a7e953f0 100644
--- a/src/utils/vhost/vhost.go
+++ b/src/utils/vhost/vhost.go
@@ -76,10 +76,19 @@ func (v *VhostMuxer) Listen(p *config.ProxyServerConf) (ls []*Listener) {
return ls
}
-func (v *VhostMuxer) getListener(name string) (l *Listener, exist bool) {
+func (v *VhostMuxer) getListener(reqInfoMap map[string]string) (l *Listener, exist bool) {
v.mutex.RLock()
defer v.mutex.RUnlock()
+ //host
+ name := strings.ToLower(reqInfoMap["Host"])
+
+ // http
+ scheme := strings.ToLower(reqInfoMap["Scheme"])
+ if scheme == "http" || scheme == "" {
+ name = name + ":" + reqInfoMap["Path"]
+ }
+
// // first we check the full hostname
vr, found := v.registryRouter.get(name)
if found {
@@ -126,12 +135,7 @@ func (v *VhostMuxer) handle(c *conn.Conn) {
return
}
- name := strings.ToLower(reqInfoMap["Host"])
- // get listener by hostname
- if reqInfoMap["Scheme"] == "http" {
- name = name + ":" + reqInfoMap["Path"]
- }
- l, ok := v.getListener(name)
+ l, ok := v.getListener(reqInfoMap)
if !ok {
c.Close()
return