@Override public final boolean usingProxy() { if (selectedProxy != null) { return isValidNonDirectProxy(selectedProxy); } // This behavior is a bit odd (but is probably justified by the // oddness of the APIs involved). Before a connection is established, // this method will return true only if this connection was explicitly // opened with a Proxy. We don't attempt to query the ProxySelector // at all. return isValidNonDirectProxy(client.getProxy()); }
@Override public final boolean usingProxy() { if (selectedProxy != null) { return isValidNonDirectProxy(selectedProxy); } // This behavior is a bit odd (but is probably justified by the // oddness of the APIs involved). Before a connection is established, // this method will return true only if this connection was explicitly // opened with a Proxy. We don't attempt to query the ProxySelector // at all. return isValidNonDirectProxy(client.getProxy()); }
@Override public final Permission getPermission() throws IOException { String hostName = getURL().getHost(); int hostPort = Util.getEffectivePort(getURL()); if (usingProxy()) { InetSocketAddress proxyAddress = (InetSocketAddress) client.getProxy().address(); hostName = proxyAddress.getHostName(); hostPort = proxyAddress.getPort(); } return new SocketPermission(hostName + ":" + hostPort, "connect, resolve"); }
@Override public final Permission getPermission() throws IOException { String hostName = getURL().getHost(); int hostPort = Util.getEffectivePort(getURL()); if (usingProxy()) { InetSocketAddress proxyAddress = (InetSocketAddress) client.getProxy().address(); hostName = proxyAddress.getHostName(); hostPort = proxyAddress.getPort(); } return new SocketPermission(hostName + ":" + hostPort, "connect, resolve"); }
Proxy selectedProxy = httpEngine.connection != null ? httpEngine.connection.getRoute().getProxy() : client.getProxy(); final int responseCode = getResponseCode(); switch (responseCode) {
Proxy selectedProxy = httpEngine.connection != null ? httpEngine.connection.getRoute().getProxy() : client.getProxy(); final int responseCode = getResponseCode(); switch (responseCode) {