Ejemplo n.º 1
0
 /** Create an HTTPS client URL. Traffic will be tunneled through the specified proxy server. */
 HttpsClient(SSLSocketFactory sf, URL url, String proxy, int proxyPort) throws IOException {
   setSSLSocketFactory(sf);
   if (proxy != null) {
     setTunnelProxy(proxy, proxyPort);
   }
   this.proxyDisabled = true;
   /*
    *try to set host to "%d.%d.%d.%d" string if
    * visible - Sprint bug - brown
    */
   try {
     InetAddress addr = InetAddress.getByName(url.getHost());
     this.host = addr.getHostAddress();
   } catch (UnknownHostException ignored) {
     this.host = url.getHost();
   }
   this.url = url;
   port = url.getPort();
   if (port == -1) {
     port = getDefaultPort();
   }
   openServer();
 }