code: func (u responseUpgrader) UpgradeResponse(w http.ResponseWriter, req *http.Request, newStreamHandler httpstream.NewStreamHandler) httpstream.Connection {
  	connectionHeader := strings.ToLower(req.Header.Get(httpstream.HeaderConnection))
  	upgradeHeader := strings.ToLower(req.Header.Get(httpstream.HeaderUpgrade))
  	if !strings.Contains(connectionHeader, strings.ToLower(httpstream.HeaderUpgrade)) || !strings.Contains(upgradeHeader, strings.ToLower(HeaderSpdy31)) {
  		errorMsg := fmt.Sprintf("unable to upgrade: missing upgrade headers in request: %#v", req.Header)
  		http.Error(w, errorMsg, http.StatusBadRequest)
  		return nil
  	}
  
  	hijacker, ok := w.(http.Hijacker)
  	if !ok {
  		errorMsg := fmt.Sprintf("unable to upgrade: unable to hijack response")
  		http.Error(w, errorMsg, http.StatusInternalServerError)
  		return nil
  	}
  
  	w.Header().Add(httpstream.HeaderConnection, httpstream.HeaderUpgrade)
  	w.Header().Add(httpstream.HeaderUpgrade, HeaderSpdy31)
  	w.WriteHeader(http.StatusSwitchingProtocols)
  
  	conn, bufrw, err := hijacker.Hijack()
  	if err != nil {
  		runtime.HandleError(fmt.Errorf("unable to upgrade: error hijacking response: %v", err))
  		return nil
  	}
  
  	connWithBuf := &connWrapper{Conn: conn, bufReader: bufrw.Reader}
  	spdyConn, err := NewServerConnection(connWithBuf, newStreamHandler)
  	if err != nil {
  		runtime.HandleError(fmt.Errorf("unable to upgrade: error creating SPDY server connection: %v", err))
  		return nil
  	}
  
  	return spdyConn
  }
docs: // UpgradeResponse upgrades an HTTP response to one that supports multiplexed
  // streams. newStreamHandler will be called synchronously whenever the
  // other end of the upgraded connection creates a new stream.