Search code examples
javalinuxsquid

how to set proxy for firefox using java?


I am trying to develop an app which will take ip address as a input and set it as a proxy in clients firefox as a proxy. The idea here is , I am trying to gain access to squid server through java? is there any possibility of doing so? Thanks in advance


Solution

  • You can configure your Java application to use Charles in code or as command line arguments to the java executable.

    System.setProperty("http.proxyHost", "127.0.0.1"); System.setProperty("http.proxyPort", "8888");

    And for HTTPS as well. Note that you may also want to configure Java to trust Charles’s root certificate in this case (see SSL Proxying).

    System.setProperty("https.proxyHost", "127.0.0.1"); System.setProperty("https.proxyPort", "8888");