简体   繁体   中英

Java System Properties reset http.proxyHost and ProxyPort

Simple question, how do I reset the http.proxyHost and http.Proxy properties back to the default?

The reason I ask is I have an application that the end user specifiy's proxy and goes to the next screen. There may be an event where they go back and decide not to use a proxy.

So I guess the question is how do i set both properties back to the default so no proxy is being used?

You can just clear the proxy.

System.clearProperty("http.proxyHost");
System.clearProperty("http.proxyPort");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM