Exemplo n.º 1
0
 static {
   isProxyingEnabled.addListener(
       (observable, oldValue, newValue) -> {
         if (newValue) {
           System.setProperty("http.proxySet", "true");
           System.setProperty("http.proxyHost", "127.0.0.1");
           System.setProperty("http.proxyPort", "8080");
           System.setProperty("https.proxySet", "true");
           System.setProperty("https.proxyHost", "127.0.0.1");
           System.setProperty("https.proxyPort", "8080");
         } else {
           System.clearProperty("http.proxySet");
           System.clearProperty("http.proxyHost");
           System.clearProperty("http.proxyPort");
           System.clearProperty("https.proxySet");
           System.clearProperty("https.proxyHost");
           System.clearProperty("https.proxyPort");
         }
       });
 }