code: private static HttpHost getSystemProxy(URI uri) throws UnknownHostException {
  
          // We do not set the java.net.useSystemProxies property here as it may
          // lead to problems in certain scenarios, e.g. when testing with OpenJDK
          // on VMs with an insufficient dependency management (see the failing
          // builds from https://github.com/terrestris/shogun-core/pull/157)
  
          // If it is necessary that this property is set to true, it should be
          // configured on the JVM via -Djava.net.useSystemProxies=true
  
          //	System.setProperty("java.net.useSystemProxies", "true");
  
          HttpHost systemProxy = null;
  
          List<Proxy> proxyList = ProxySelector.getDefault().select(uri);
  
          for (Iterator<Proxy> iterator = proxyList.iterator(); iterator.hasNext(); ) {
              Proxy proxy = iterator.next();
              InetSocketAddress address = (InetSocketAddress) proxy.address();
  
              if (address != null) {
                  LOG.debug("Detected a system wide proxy: " +
                      "  * Host: " + address.getHostName() +
                      "  * Port: " + address.getPort()
                  );
  
                  systemProxy = new HttpHost(InetAddress.getByName(address.getHostName()),
                      address.getPort(), "http");
                  break;
  
              }
          }
  
          return systemProxy;
      }
docs: If the JVM knows about a HTTP proxy, e.g. by specifying
  <p>
  <pre>
  -Dhttp.proxyHost=schwatzgelb.de -Dhttp.proxyPort=8080
  </pre>
  <p>
  as startup parameters, this method will correctly detect them and return
  an InetSocketAddress ready to be used to pass the proxy to the
  DefaultHttpClient.
  
  @param uri
  @return
  @throws UnknownHostException