code: private static Proxy forEnvOpt(String proxy, String noProxy) {
          URI uri;
          int port;
          Proxy result;
  
          if (proxy == null) {
              return null;
          }
          try {
              uri = new URI(proxy);
          } catch (URISyntaxException e) {
              throw new IllegalArgumentException("invalid value for http_proxy: " + proxy, e);
          }
          port = uri.getPort();
          if (port == -1) {
              port = 80;
          }
          result = new Proxy(uri.getHost(), port);
          for (String exclude : Separator.COMMA.split(noProxy == null ? "" : noProxy)) {
              if (exclude.startsWith(".")) {
                  exclude = '*' + exclude;
              }
              result.excludes.add(exclude);
          }
          return result;
      }
docs: Turn Java proxy properties for http_proxy and no_proxy environment variables into the
  respective Java properties. See
  - http://wiki.intranet.1and1.com/bin/view/UE/HttpProxy
  - http://info4tech.wordpress.com/2007/05/04/java-http-proxy-settings/
  - http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
  - http://docs.oracle.com/javase/7/docs/api/java/net/doc-files/net-properties.html#Proxies