How can I make FTP connections through a proxy server?

Tim Rohaly

Java uses three system properties to designate an FTP proxy: ftp.useProxy, ftp.proxyHost and ftp.proxyPort. For applets, these are automatically set to use the browser's settings. However, in an application you need to set them yourself:

Properties props = System.getProperties();
props.put("ftp.useProxy", "true");
props.put("ftp.proxyHost", "proxyhostname");
props.put("ftp.proxyPort", "proxyhostport");

See also How can I download files from a URL using FTP?.

0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact