Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Guest

Hi again

I found a solution... I just needed to do the following:
SessionOptions sessionOptions = new SessionOptions 

{
    Protocol = Protocol.Ftp,
    HostName = "proxyhost",
    PortNumber = 21,
    UserName = "username@hostname proxyusername",
    Password = "password"
};

sessionOptions.AddRawSettings("FtpAccount", "proxypassword");
jkildedal

Proxy settings with custom format (works in Filezilla, but not WinSCP)

Hi

I am trying to access an ftp server through a proxy server. I managed to get it working in Filezilla, but cannot get it working in WinSCP. I even tried importing the Filezilla site, but each time I get the response:

Connection failed.
Authentication failed.
Connection failed.
User Access denied.

Usage: USER username@hostname proxyusername
PASS password
ACCT proxypassword


If I use the "Generate Session URL/Code..." option the following settings are revealed:
SessionOptions sessionOptions = new SessionOptions

{
    Protocol = Protocol.Ftp,
    HostName = "proxyhost",
    PortNumber = 21,
    UserName = "username@hostname proxyusername",
};

using (Session session = new Session())
{
    // Connect
    session.Open(sessionOptions);

    // Your code
}


I also tried these sessionOptions which seemed logical, but here I get a timeout.
SessionOptions sessionOptions = new SessionOptions

{
    Protocol = Protocol.Ftp,
    HostName = "hostname",
    PortNumber = 21,
    UserName = "username",
    Password = "password",
};

sessionOptions.AddRawSettings("FtpProxyLogonType", "7");
sessionOptions.AddRawSettings("ProxyHost", "proxyhost");
sessionOptions.AddRawSettings("ProxyUsername", "proxyusername");
sessionOptions.AddRawSettings("ProxyPassword", "proxypassword");


What am I doing wrong and what are the right settings?