func NewClient(c Conn, chans <-chan NewChannel, reqs <-chan *Request) *Client {
	conn := &Client{
		Conn:            c,
		channelHandlers: make(map[string]chan NewChannel, 1),
	}
	go conn.handleGlobalRequests(reqs)
	go conn.handleChannelOpens(chans)
	go func() {
		conn.Wait()
		conn.forwards.closeAll()
	}()
	go conn.forwards.handleChannels(conn.HandleChannelOpen("forwarded-tcpip"))
	go conn.forwards.handleChannels(conn.HandleChannelOpen("forwarded-streamlocal@openssh.com"))
	return conn
}
NewClient creates a Client on top of the given connection.
package ssh
import (
	"bytes"
	"errors"
	"fmt"
	"net"
	"sync"
	"time"
)
type Client struct {
	Conn
	forwards        forwardList  
	mu              sync.Mutex
	channelHandlers map[string]chan NewChannel
}
func (c *Client) HandleChannelOpen(channelType string) <-chan NewChannel {
	c.mu.Lock()
	defer c.mu.Unlock()
	if c.channelHandlers == nil {
		c := make(chan NewChannel)
		close(c)
		return c
	}
	ch := c.channelHandlers[channelType]
	if ch != nil {
		return nil
	}
	ch = make(chan NewChannel, chanSize)
	c.channelHandlers[channelType] = ch
	return ch
}