You need to set the “Proxy-Authorization” request property.
URLConnection connection = url.openConnection();
String authentication = username"+":"+password;
String encodedAuthentication = base64Encode(authentication);
connection.setRequestProperty("Proxy-Authorization",
encodedAuthentication);
How to specify the proxy server to use is cover here.
written by objects
\\ tags: authentication, proxy, URLConnection
Set the following system properties
- ftp.proxyHost
- ftp.proxyPort
java -Dftp.proxyHost=proxy.objects.com.au -Dftp.proxyPort=80 au.com.objects.MyApplication
To do the same programatically use the System classess setProperty() method
System.setProperty("ftp.proxyHost", proxyHostname);
System.setProperty("ftp.proxyPort", proxyPort);
written by objects
\\ tags: ftp, proxy, system property
Set the following system properties
- http.proxyHost
- http.proxyPort
java -Dhttp.proxyHost=proxy.objects.com.au -Dhttp.proxyPort=8080 au.com.objects.MyApplication
To do the same programatically use the System classess setProperty() method
System.setProperty("http.proxyHost", proxyHostname);
System.setProperty("http.proxyPort", proxyPort);
written by objects
\\ tags: http, proxy, system property
Recent Comments