code: func IsWebSocketRequest(req *http.Request) bool {
  	if !strings.EqualFold(req.Header.Get("Upgrade"), "websocket") {
  		return false
  	}
  	return connectionUpgradeRegex.MatchString(strings.ToLower(req.Header.Get("Connection")))
  }
docs: // IsWebSocketRequest returns true if the incoming request contains connection upgrade headers
  // for WebSockets.