0 votes
by (8.4k points)
edited

Hi,

Does Rebex FTP/SSL component support ProxySG? I was able to connect via ProxySG with FileZilla client following this tutorial.

Applies to: Rebex FTP/SSL

1 Answer

0 votes
by (58.9k points)
edited
 
Best answer

Hello,

connecting to an FTP server via ProxySG proxy is possible with Rebex FTP component. The protocol for ProxySG corresponds to the following FTP commands:

USER %userName@%host %proxyUser
PASS %password
ACCT %proxyPassword

Practically you Connect to the proxyHost first and then use Login method like this:

                string host = "ftp.company.com";
                string userName = "user";
                string password = "pass";

                string proxyUser = "proxyUser";
                string proxyPassword = "proxyPass";
                string proxyHost = "proxyHost";

                Ftp ftp = new Ftp();

                // connect to the proxy server
                ftp.Connect(proxyHost);

                // create username in the special format "username@host proxyUser"
                string user = string.Format("{0}@{1} {2}", userName, host, proxyUser);

                // login with the specially created username
                // provide password as 2nd and proxyPassword as 3rd argument to the Login method
                ftp.Login(user, password, proxyPassword);

                //do work

                ftp.Disconnect();
...