code: func (h *HandlerFunc) ServeHTTP(w http.ResponseWriter, req *http.Request) {
  	ip, err := HTTPRequestLookup(req)
  	if err != nil {
  		log.Printf("failed to lookup request address: %v", err)
  		status := http.StatusInternalServerError
  		http.Error(w, http.StatusText(status), status)
  		return
  	}
  
  	if h.whitelist.Permitted(ip) {
  		h.allow(w, req)
  	} else {
  		if h.deny == nil {
  			status := http.StatusUnauthorized
  			http.Error(w, http.StatusText(status), status)
  		} else {
  			h.deny(w, req)
  		}
  	}
  }
docs: // ServeHTTP checks the incoming request to see whether it is permitted,
  // and calls the appropriate handle function.