Skip to content
Advertisement

Java Using proxy settings in jar

I’m doing a webscraping with jar i created, which uses a proxy. My question is that i have large project where more webscrapers will work in paralel.

Using this code:

System.getProperties().put("http.proxyHost", "someProxyURL");
System.getProperties().put("http.proxyPort", "someProxyPort");
System.getProperties().put("http.proxyUser", "someUserName");
System.getProperties().put("http.proxyPassword", "somePassword");

will affect the others webscrapers?

Advertisement

Answer

If you run them as separate processes, then each process has its own system properties. If you are running them in one process as separate threads, they share those properties.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement