code: func (h *virtualHostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
  	// if r.Host is not set, we can continue serving since a browser would set the Host header
  	if r.Host == "" {
  		h.next.ServeHTTP(w, r)
  		return
  	}
  	host, _, err := net.SplitHostPort(r.Host)
  	if err != nil {
  		// Either invalid (too many colons) or no port specified
  		host = r.Host
  	}
  	if ipAddr := net.ParseIP(host); ipAddr != nil {
  		// It's an IP address, we can serve that
  		h.next.ServeHTTP(w, r)
  		return
  
  	}
  	// Not an ip address, but a hostname. Need to validate
  	if _, exist := h.vhosts["*"]; exist {
  		h.next.ServeHTTP(w, r)
  		return
  	}
  	if _, exist := h.vhosts[host]; exist {
  		h.next.ServeHTTP(w, r)
  		return
  	}
  	http.Error(w, "invalid host specified", http.StatusForbidden)
  }
docs: // ServeHTTP serves JSON-RPC requests over HTTP, implements http.Handler