@@ -24,12 +24,13 @@ public SshConnector(IServiceFactory serviceFactory, ISocketFactory socketFactory
2424
2525 public override Socket Connect ( IConnectionInfo connectionInfo )
2626 {
27- if ( connectionInfo == null )
28- throw new ArgumentNullException ( "connectionInfo" ) ;
29- if ( connectionInfo . GetType ( ) != typeof ( ConnectionInfo ) )
27+ var proxyConnection = connectionInfo . ProxyConnection ;
28+ if ( proxyConnection == null )
29+ throw new ArgumentNullException ( "connectionInfo.ProxyConnection" ) ;
30+ if ( proxyConnection . GetType ( ) != typeof ( ConnectionInfo ) )
3031 throw new ArgumentException ( "Expecting connectionInfo to be of type ConnectionInfo" ) ;
3132
32- _jumpSession = new Session ( ( ConnectionInfo ) connectionInfo , ServiceFactory , SocketFactory ) ;
33+ _jumpSession = new Session ( ( ConnectionInfo ) proxyConnection , ServiceFactory , SocketFactory ) ;
3334 _jumpSession . Connect ( ) ;
3435 _jumpChannel = new JumpChannel ( _jumpSession , connectionInfo . Host , ( uint ) connectionInfo . Port ) ;
3536 return _jumpChannel . Connect ( ) ;
@@ -38,12 +39,13 @@ public override Socket Connect(IConnectionInfo connectionInfo)
3839#if FEATURE_TAP
3940 public override async Task < Socket > ConnectAsync ( IConnectionInfo connectionInfo , CancellationToken cancellationToken )
4041 {
41- if ( connectionInfo == null )
42- throw new ArgumentNullException ( "connectionInfo" ) ;
43- if ( connectionInfo . GetType ( ) != typeof ( ConnectionInfo ) )
42+ var proxyConnection = connectionInfo . ProxyConnection ;
43+ if ( proxyConnection == null )
44+ throw new ArgumentNullException ( "connectionInfo.ProxyConnection" ) ;
45+ if ( proxyConnection . GetType ( ) != typeof ( ConnectionInfo ) )
4446 throw new ArgumentException ( "Expecting connectionInfo to be of type ConnectionInfo" ) ;
4547
46- _jumpSession = new Session ( ( ConnectionInfo ) connectionInfo , ServiceFactory , SocketFactory ) ;
48+ _jumpSession = new Session ( ( ConnectionInfo ) proxyConnection , ServiceFactory , SocketFactory ) ;
4749 await _jumpSession . ConnectAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
4850 _jumpChannel = new JumpChannel ( _jumpSession , connectionInfo . Host , ( uint ) connectionInfo . Port ) ;
4951 return _jumpChannel . Connect ( ) ;
0 commit comments