Problem to connect using the PROXY Squid

Sep 13, 2013 at 9:10 AM
I have a problem to connect with the server SFTP (SSH Server Bitvise 5.54) when using the PROXY (Squid Cache: Version 2.7.STABLE8) filezilla client (version 3.7.3) if the connection succeeds, but with the library renci.sshnet (version 2013.4.7) SFTP I get to where I see the connection attempt, but sshnet returns the exception "Socket read operation has timed out"
Sep 17, 2013 at 10:35 AM
Edited Sep 17, 2013 at 10:36 AM
I tested with other libraries SFTP: chilkatsoft and nSoftware.
I have no problem using the SQUID proxy with the same settings I have indicated ..
Sep 18, 2013 at 4:09 PM
no shirt, no code, no service ;)

Please give us your code. Everything else is just guessing.
Sep 23, 2013 at 5:45 AM
Edited Sep 23, 2013 at 8:15 AM
using System;
using Renci.SshNet;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

            const string host = "demo.wftpserver.com";
            const int port = 2222;
            const string userName = "demo-user";
            const string password = "demo-user";

            const ProxyTypes pType = ProxyTypes.Http;
            const string pHost = "127.0.0.1";
            const int pPort = 3128;

            var sFtp_Autentication = new PasswordAuthenticationMethod(userName, password);

            var connectInfo = new ConnectionInfo(host, port, userName, pType, pHost, pPort, "", "", sFtp_Autentication);
            
            //var connectInfo = new ConnectionInfo(host, port,userName,  sFtp_Autentication);

            Console.WriteLine("Creating client and connecting");
            Console.WriteLine(host);

            using (SftpClient client = new SftpClient(connectInfo))
            {
                try
                {
                    client.OperationTimeout = new TimeSpan(0, 0, 30);
                    client.Connect();
                }
                catch (Exception exe)
                {
                    Console.WriteLine(exe.ToString());
                }
                if (client.IsConnected)
                {
                    Console.WriteLine("Connected to {0}", host);
                    var ls = client.ListDirectory(".");
                    foreach (var s in ls)
                    {
                        Console.WriteLine(s);
                    }
                }
                else
                    Console.Write("Not Connected");


                Console.Read();
            }

        }
    }
}
Connect ok using code:
var connectInfo = new ConnectionInfo(host, port,userName,  sFtp_Autentication);
Message:
Creating client and connecting
demo.wftpserver.com
Connected to demo.wftpserver.com
Name You can upload file into [upload], Length 34, User ID 0, Group ID 0, Access
ed 19/09/2013 9:27:44, Modified 08/08/2013 9:23:27
Name download, Length 4096, User ID 0, Group ID 0, Accessed 22/09/2013 4:56:11,
Modified 07/08/2013 18:05:06
Name upload, Length 20480, User ID 0, Group ID 0, Accessed 23/09/2013 3:08:00, M
odified 23/09/2013 7:22:03
Not Connect using code:
var connectInfo = new ConnectionInfo(host, port, userName, pType, pHost, pPort, "", "", sFtp_Autentication);
Mensage with Proxy port 2222 worked and allowed (not OK):
Creating client and connecting
demo.wftpserver.com
Renci.SshNet.Common.SshOperationTimeoutException: Socket read operation has time
d out
   en Renci.SshNet.Session.SocketReadLine(String& response)
   en Renci.SshNet.Session.ConnectHttp()
   en Renci.SshNet.Session.Connect()
   en Renci.SshNet.BaseClient.Connect()
   en ConsoleApplication1.Program.Main(String[] args) en c:\users\manuel\documen
ts\visual studio 2010\Projects\ConsoleApplication1\ConsoleApplication1\Program.c
s:línea 34
Not Connected
Message if the proxy is stopped (is OK):

Creating client and connecting
demo.wftpserver.com
System.Net.Sockets.SocketException (0x80004005): No se puede establecer una cone
xión ya que el equipo de destino denegó expresamente dicha conexión 127.0.0.1:31
28
   en System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   en Renci.SshNet.Session.SocketConnect(String host, Int32 port)
   en Renci.SshNet.Session.Connect()
   en Renci.SshNet.BaseClient.Connect()
   en ConsoleApplication1.Program.Main(String[] args) en c:\users\manuel\documen
ts\visual studio 2010\Projects\ConsoleApplication1\ConsoleApplication1\Program.c
s:línea 34
Not Connected
Thanks for your help.
Sep 23, 2013 at 8:06 AM
Please use some formatting. Getting a headache trying to encrypt this...
Sep 23, 2013 at 8:17 AM
As I proceeded to format the message above.
Sorry, and Thanks.