How do I use a TIdFTP with a SOCKS proxy?

Previous  Top  Next

For Indy 8.0

 

In Delphi, do the following:

 

IdFTP1.SocksInfo.Host := [the DNS name of the proxy server or its IP address]

IdFTP1.SocksInfo.Protocol := [svNoSocks for no SOCKS support, svSocks4 for SOCKS 4, svSocks4A for SOCKS 4 with protocol extension, and svSocks5 for SOCKS 5 protocol]

IdFTP1.SocksInfo.Authentication := [saNoAuthentication for no SOCKS authentication or saUsernamePassword for username and password authentication]

IdFTP1.Passive := True;

 

In C++Builder, do the following:

 

IdFTP1->SocksInfo->Host = [the DNS name of the proxy server or its IP address]

IdFTP1->SocksInfo->Protocol = [svNoSocks for no SOCKS support, svSocks4 for SOCKS 4, svSocks4A for SOCKS 4 with protocol extension, and svSocks5 for SOCKS 5 protocol]

IdFTP1->SocksInfo->Authentication = [saNoAuthentication for no SOCKS authentication or saUsernamePassword for username and password authentication]

IdFTP1->Passive = True

 

For Indy 9.0

 

1.Create an IOHandler such as TIdIOHandlerSocket or TIdSSLIOHandlerSocket and assign the TIdFTP.IOHandler property this. 
2.Set the TIdFTP.Passive property to true.
3.Create a TIdSocksInfo object and assign it to the IOHandler's SocksInfo property.
4.Set the TIdSocksInfo properties as required.

 

For Indy 10

 

1.Create an IOHandler such as TIdIOHandlerStack or SSL IOHandler and assign the TIdFTP.IOHandler property this. 
2.Create a TIdSocksInfo object and assign it to the IOHandler's TransparentProxy property.
3.Set the TIdSocksInfo properties as required.
4.If there is another proxy that the SOCKS Proxy itself needs to use, you have to use, set the Chained Proxy to a TIdCustomTransparentProxy such as TIdSocksInfo for another socks Proxy or a TIdConnectThroughHttpProxy for a HTTP Tunneling proxy.
5.If you are not using another type of chained proxy, you may be able to use standard PORT transfers if your SOCKS proxy supports the bind method described in SOCKS: A protocol for TCP proxy across firewalls (http://archive.socks.permeo.com/protocol/socks4.protocol) and RFC 1928 - SOCKS Protocol Version 5.  If your SOCKS proxy does not support that capability, you have to use PASV (Passive := True) transfers.