use of okhttp3.internal.huc.OkHttpsURLConnection in project okhttp by square.
the class OkUrlFactory method open.
HttpURLConnection open(URL url, Proxy proxy) {
String protocol = url.getProtocol();
OkHttpClient copy = client.newBuilder().proxy(proxy).build();
if (protocol.equals("http"))
return new OkHttpURLConnection(url, copy, urlFilter);
if (protocol.equals("https"))
return new OkHttpsURLConnection(url, copy, urlFilter);
throw new IllegalArgumentException("Unexpected protocol: " + protocol);
}
use of okhttp3.internal.huc.OkHttpsURLConnection in project NoHttp by yanzhenjie.
the class URLConnectionFactory method open.
/**
* Open url.
*
* @param url {@link URL}.
* @param proxy {@link Proxy}.
* @return {@link HttpURLConnection}.
*/
public HttpURLConnection open(URL url, Proxy proxy) {
OkHttpClient copy = mClient.newBuilder().proxy(proxy).build();
String protocol = url.getProtocol();
if (protocol.equals("http"))
return new OkHttpURLConnection(url, copy);
if (protocol.equals("https"))
return new OkHttpsURLConnection(url, copy);
throw new IllegalArgumentException("Unexpected protocol: " + protocol);
}
Aggregations