Setting JVM/JRE to use Windows Proxy Automatically

前端 未结 6 1344
[愿得一人]
[愿得一人] 2020-11-28 06:29

I did see the question about setting the proxy for the JVM but what I want to ask is how one can utilize the proxy that is already configured (on Windows).

Here is a

6条回答
  •  遥遥无期
    2020-11-28 06:42

    UPDATE: you need to have the System Property java.net.useSystemProxies set to true for my solution below to work.

    If you use java.net.URL.openStream() to get an InputStream for the web resource content you automatically get the same proxy used as Internet Explorer would use for that URL.

    No need to go to the Java Control Panel or to display the proxy used.

提交回复
热议问题