I want to set up an FTP connection using a proxy server with Apache's commons-net.
But looking at this Does FTPClient support FTP connections through an FTP proxy server? has me worried.
I have to meddle with the system properties and the Sun docs state that "If socksProxyHost is specified then all TCP sockets will use the SOCKS proxy server to establish a connection or accept one."
WTH? All TCP sockets? What about my database connections? Or other FTP connections i might want to open at the same time not using a proxy? Will they all be affected?
Is there some other way to do it that doesn't mess with the rest of my application?
The FTP proxy functions as a relay for the File Transfer Protocol to enable you control connections based upon source and destination addresses and user authentication. It can also limit access to certain file transfer commands, such as put and get , based on source or destination addresses and user authentication.
A configuration to proxy browser-based connections to FTP sites. “FTP-over-HTTP” refers to proxying browser-based connections to FTP sites.
You have several ways of using proxies in Java, especially from version 1.5.
java.net.Proxy
class (Java 1.5+) to set (or not) a Proxy
per Connection
java.net.ProxySelector
(idem) which will determine a Proxy
for each Connection
according to your criteriaSee the detailled Sun technote on networking & proxies.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With