namespace FluentFTP.Proxy { /// A FTP client with a user@host proxy identification. public class FtpClientUserAtHostProxy : FtpClientProxy { /// A FTP client with a user@host proxy identification. /// Proxy information public FtpClientUserAtHostProxy(ProxyInfo proxy) : base(proxy) { ConnectionType = "User@Host"; } /// /// Creates a new instance of this class. Useful in FTP proxy classes. /// protected override FtpClient Create() { return new FtpClientUserAtHostProxy(Proxy); } /// Redefine the first dialog: auth with proxy information protected override void Handshake() { // Proxy authentication eventually needed. if (Proxy.Credentials != null) Authenticate(Proxy.Credentials.UserName, Proxy.Credentials.Password); // Connection USER@Host means to change user name to add host. Credentials.UserName = Credentials.UserName + "@" + Host; } } }