Many times, a Java app needs to connect to the Internet. The most common example happens when it is reading an XML file and needs to download its schema.
I am behind a proxy server. How do I set my JVM to use the proxy ?
Many times, a Java app needs to connect to the Internet. The most common example happens when it is reading an XML file and needs to download its schema.
I am behind a proxy server. How do I set my JVM to use the proxy ?
To set an HTTP/HTTPS and/or SOCKS proxy programmatically:
Remember that HTTP proxies and SOCKS proxies operate at different levels in the network stack, so you can use one or the other or both.
Combining Sorter's and javabrett/Leonel's answers:
To use the system proxy setup:
Or programatically:
Source: http://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html
I am also behind firewall, this worked for me!!
If you want "Socks Proxy", inform the "socksProxyHost" and "socksProxyPort" VM arguments.
e.g.
Add this before you connect to a URL behind a proxy.