From e435bd2300b04cc5238fe9cda1bb29e849eac623 Mon Sep 17 00:00:00 2001 From: olegkap_cp Date: Wed, 4 Jan 2012 14:56:58 +0000 Subject: [PATCH] Add SOCKS4 & SOCKS5 Proxy support when connecting to remote server. For silverlight only IP address can be used for server address when using proxy. Usage example: var connectionInfo = new PasswordConnectionInfo("1.2.3.4", "username", "password", ProxyTypes.Socks4, "127.0.0.1", 8088); using (var ssh = new SshClient(connectionInfo)) { ssh.Connect(); var rrr = ssh.RunCommand("ls -l"); } --- .../Renci.SshNet.NET35.csproj | 8 +- .../Renci.SshNet.Silverlight.csproj | 8 +- .../Session.SilverlightShared.cs | 4 +- .../Renci.SshNet.WindowsPhone.csproj | 8 +- .../Common/ProxyException.NET40.cs | 26 ++ .../Renci.SshNet/Common/ProxyException.cs | 42 +++ .../Renci.SshNet/Common/ScpException.NET40.cs | 5 +- .../Renci.SshNet/ConnectionInfo.cs | 78 +++++- .../KeyboardInteractiveConnectionInfo.cs | 94 ++++++- .../Renci.SshNet/NoneConnectionInfo.cs | 103 ++++++- .../Renci.SshNet/PasswordConnectionInfo.cs | 94 ++++++- .../Renci.SshNet/PrivateKeyConnectionInfo.cs | 97 ++++++- Renci.SshClient/Renci.SshNet/ProxyTypes.cs | 20 ++ .../Renci.SshNet/Renci.SshNet.csproj | 7 + Renci.SshClient/Renci.SshNet/Session.NET.cs | 4 +- Renci.SshClient/Renci.SshNet/Session.cs | 263 +++++++++++++++++- 16 files changed, 835 insertions(+), 26 deletions(-) create mode 100644 Renci.SshClient/Renci.SshNet/Common/ProxyException.NET40.cs create mode 100644 Renci.SshClient/Renci.SshNet/Common/ProxyException.cs create mode 100644 Renci.SshClient/Renci.SshNet/ProxyTypes.cs diff --git a/Renci.SshClient/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj b/Renci.SshClient/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj index 778d4705..fcbf3c44 100644 --- a/Renci.SshClient/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj +++ b/Renci.SshClient/Renci.SshNet.NET35/Renci.SshNet.NET35.csproj @@ -133,6 +133,9 @@ Common\PortForwardEventArgs.cs + + Common\ProxyException.cs + Common\ScpDownloadEventArgs.cs @@ -448,6 +451,9 @@ PrivateKeyFile.cs + + ProxyTypes.cs + ScpClient.cs @@ -736,7 +742,7 @@ - +