const defaultIdleConnectionTimeout … const writeErrorDeadline … type Options … type conns … // Create WebSocket server streams to respond to a WebSocket client. Creates the streams passed // in the stream options. func webSocketServerStreams(req *http.Request, w http.ResponseWriter, opts Options) (*conns, error) { … } // Read terminal resize events off of passed stream and queue into passed channel. func handleResizeEvents(ctx context.Context, stream io.Reader, channel chan<- remotecommand.TerminalSize) { … } // createChannels returns the standard channel types for a shell connection (STDIN 0, STDOUT 1, STDERR 2) // along with the approximate duplex value. It also creates the error (3) and resize (4) channels. func createChannels(opts Options) []wsstream.ChannelType { … } // readChannel returns wsstream.ReadChannel if real is true, or wsstream.IgnoreChannel. func readChannel(real bool) wsstream.ChannelType { … } // writeChannel returns wsstream.WriteChannel if real is true, or wsstream.IgnoreChannel. func writeChannel(real bool) wsstream.ChannelType { … } // createWebSocketStreams returns a "conns" struct containing the websocket connection and // streams needed to perform an exec or an attach. func createWebSocketStreams(req *http.Request, w http.ResponseWriter, opts Options) (*conns, error) { … }