type fakeDialer … func (d *fakeDialer) Dial(protocols ...string) (httpstream.Connection, string, error) { … } type fakeConnection … func newFakeConnection() *fakeConnection { … } func (c *fakeConnection) CreateStream(headers http.Header) (httpstream.Stream, error) { … } func (c *fakeConnection) Close() error { … } func (c *fakeConnection) CloseChan() <-chan bool { … } func (c *fakeConnection) RemoveStreams(streams ...httpstream.Stream) { … } func (c *fakeConnection) SetIdleTimeout(timeout time.Duration) { … } type fakeListener … func newFakeListener() fakeListener { … } func (l *fakeListener) Accept() (net.Conn, error) { … } func (l *fakeListener) Close() error { … } func (l *fakeListener) Addr() net.Addr { … } type fakeAddr … func (fakeAddr) Network() string { … } func (fakeAddr) String() string { … } type fakeStream … func (s *fakeStream) Read(p []byte) (n int, err error) { … } func (s *fakeStream) Write(p []byte) (n int, err error) { … } func (*fakeStream) Close() error { … } func (*fakeStream) Reset() error { … } func (s *fakeStream) Headers() http.Header { … } func (*fakeStream) Identifier() uint32 { … } type fakeConn … func (f fakeConn) Read(p []byte) (int, error) { … } func (f fakeConn) Write(p []byte) (int, error) { … } func (fakeConn) Close() error { … } func (fakeConn) LocalAddr() net.Addr { … } func (fakeConn) RemoteAddr() net.Addr { … } func (fakeConn) SetDeadline(t time.Time) error { … } func (fakeConn) SetReadDeadline(t time.Time) error { … } func (fakeConn) SetWriteDeadline(t time.Time) error { … } func TestParsePortsAndNew(t *testing.T) { … } type GetListenerTestCase … func TestGetListener(t *testing.T) { … } func TestGetPortsReturnsDynamicallyAssignedLocalPort(t *testing.T) { … } func TestHandleConnection(t *testing.T) { … } func TestHandleConnectionSendsRemoteError(t *testing.T) { … } func TestWaitForConnectionExitsOnStreamConnClosed(t *testing.T) { … } func TestForwardPortsReturnsErrorWhenConnectionIsLost(t *testing.T) { … } func TestForwardPortsReturnsNilWhenStopChanIsClosed(t *testing.T) { … }