func echoStream(s smux.Stream) { defer s.Close() fmt.Println("accepted stream") io.Copy(s, s) // echo everything fmt.Println("closing stream") }
func echoStream(s smux.Stream) { defer s.Close() log("accepted stream") io.Copy(&LogWriter{s}, s) // echo everything log("closing stream") }