code: func (t *TerminalHandler) Serve(w http.ResponseWriter, r *http.Request) {
  	// This allows closing of the websocket if the user logs out before exiting
  	// the session.
  	t.ctx.AddClosers(t)
  	defer t.ctx.RemoveCloser(t)
  
  	// We initial a server explicitly here instead of using websocket.HandlerFunc
  	// to set an empty origin checker (this is to make our lives easier in tests).
  	// The main use of the origin checker is to enforce the browsers same-origin
  	// policy. That does not matter here because even if malicious Javascript
  	// would try and open a websocket the request to this endpoint requires the
  	// bearer token to be in the URL so it would not be sent along by default
  	// like cookies are.
  	ws := &websocket.Server{Handler: t.handler}
  	ws.ServeHTTP(w, r)
  }
docs: // Serve builds a connect to the remote node and then pumps back two types of
  // events: raw input/output events for what's happening on the terminal itself
  // and audit log events relevant to this session.