code: public static HttpTransport createHttpTransport(
        HttpTransportType type,
        @Nullable String proxyAddress,
        @Nullable String proxyUsername,
        @Nullable String proxyPassword)
        throws IOException {
      logger.atFine().log(
          "createHttpTransport(%s, %s, %s, %s)",
          type, proxyAddress, toSecretString(proxyUsername), toSecretString(proxyPassword));
      checkArgument(
          proxyAddress != null || (proxyUsername == null && proxyPassword == null),
          "if proxyAddress is null then proxyUsername and proxyPassword should be null too");
      checkArgument(
          (proxyUsername == null) == (proxyPassword == null),
          "both proxyUsername and proxyPassword should be null or not null together");
      URI proxyUri = parseProxyAddress(proxyAddress);
      try {
        switch (type) {
          case APACHE:
            Credentials proxyCredentials =
                proxyUsername != null
                    ? new UsernamePasswordCredentials(proxyUsername, proxyPassword)
                    : null;
            return createApacheHttpTransport(proxyUri, proxyCredentials);
          case JAVA_NET:
            PasswordAuthentication proxyAuth =
                proxyUsername != null
                    ? new PasswordAuthentication(proxyUsername, proxyPassword.toCharArray())
                    : null;
            return createNetHttpTransport(proxyUri, proxyAuth);
          default:
            throw new IllegalArgumentException(
                String.format("Invalid HttpTransport type '%s'", type.name()));
        }
      } catch (GeneralSecurityException e) {
        throw new IOException(e);
      }
    }
docs: Create an {@link HttpTransport} based on an type class and an optional HTTP proxy.
  
  @param type The type of HttpTransport to use.
  @param proxyAddress The HTTP proxy to use with the transport. Of the form hostname:port. If
  empty no proxy will be used.
  @param proxyUsername The HTTP proxy username to use with the transport. If empty no proxy
  username will be used.
  @param proxyPassword The HTTP proxy password to use with the transport. If empty no proxy
  password will be used.
  @return The resulting HttpTransport.
  @throws IllegalArgumentException If the proxy address is invalid.
  @throws IOException If there is an issue connecting to Google's Certification server.