How to force any Java program to use HTTP proxy

By Angsuman Chakraborty, Gaea News Network
Tuesday, April 14, 2009

You can either specify it on command line or within program code by setting three system properties as below:

  1. proxyHost=proxy_host_name
  2. proxyPort=proxy_port
  3. proxySet=true

For example if a proxy is running on localhost at port 8080 then we can use:

java -DproxyHost=localhost -DproxyPort=8080 -DproxySet=true YourProgram

The same properties can be set within your Java program by System.getProperties().put(key, value);

That’s it folks!

Discussion
July 4, 2009: 12:49 pm

Hi,

You may be interested in this database of open source HTTP proxies written in Java.

https://proxies.xhaus.com/java/

There’s also a list of open source HTTP proxies written in python.

https://proxies.xhaus.com/python

Regards,

Alan.

YOUR VIEW POINT
NAME : (REQUIRED)
MAIL : (REQUIRED)
will not be displayed
WEBSITE : (OPTIONAL)
YOUR
COMMENT :