Unable to connect to FTP Server with SOCKS5 using WinSCP

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Unable to connect to FTP Server with SOCKS5 using WinSCP



I choose WinSCP so I can implement a SOCKS5 Proxy into my FTP Client.
With the Proxy commented out I am able to connect and download files from a FTP Server without a proxy.
If I try to connect to the FTP Server with SOCKS5 Proxy I am unable to connect.
Any erros in my proxy configuration or something ? LoginData is correct, works with filezilla.


public void Download(string LocalFile)
{
try
{
// Setup session options
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = LoginData.Servername,
UserName = LoginData.Username,
Password = LoginData.Passwort,
};

// Configure proxy
sessionOptions.AddRawSettings("ProxyMethod", "2"); // socks5 proxy
sessionOptions.AddRawSettings("ProxyHost", "***"); //host ip
sessionOptions.AddRawSettings("ProxyPort", "***"); //Port
sessionOptions.AddRawSettings("ProxyUsername", "***"); //Username
sessionOptions.AddRawSettings("ProxyPassword", "***"); //Password

using (Session session = new Session())
{
session.DisableVersionCheck = true;

// Connect
session.Open(sessionOptions);

// Download files
TransferOptions transferOptions = new TransferOptions();
transferOptions.TransferMode = TransferMode.Binary;

TransferOperationResult transferResult;
transferResult =
session.GetFiles(LoginData.RemoteFile, LocalFile, false, transferOptions);

// Throw on any error
transferResult.Check();

// Print results
foreach (TransferEventArgs transfer in transferResult.Transfers)
{
Console.WriteLine("Download of {0} succeeded", transfer.FileName);
}
}

}
catch (Exception e)
{
Console.WriteLine("Error: {0}", e);
}
}









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

IBbawFWO85xR
5b OC6sM4vJ 5Cuky22fxV vuiY2skvt 6gxa dzIpY2 vtb,N7j,QSVwb9vGv Fb,tos57x,e2RHBYN,4QV6ZvKh74GYxLPbv1 Va7

Popular posts from this blog

Makefile test if variable is not empty

Will Oldham

Visual Studio Code: How to configure includePath for better IntelliSense results