@Override public boolean usingProxy() { return delegate.usingProxy(); }
@Override public boolean usingProxy() { return delegate.usingProxy(); }
@Getter public boolean isUsingProxy() { return ((HttpURLConnection)getWrappedObject()).usingProxy(); }
/** {@inheritDoc} */ @Override public boolean usingProxy() { return wrappedUrlConnection.usingProxy(); }
protected boolean usingProxy() { return connection.usingProxy(); } protected void setFixedLengthStreamingMode(int i) {
protected boolean usingProxy() { return connection.usingProxy(); } protected void setFixedLengthStreamingMode(int i) {
/** {@inheritDoc} */ @Override public boolean usingProxy() { return wrappedUrlConnection.usingProxy(); }
@Override public boolean usingProxy() { return delegate.usingProxy(); }
protected boolean usingProxy() { return connection.usingProxy(); } protected void setFixedLengthStreamingMode(int i) {
@Override public boolean usingProxy () { return this.connection.usingProxy(); }
@Override public boolean usingProxy () { return this.connection.usingProxy(); }
@Override public boolean usingProxy() { return delegate.usingProxy(); }
public boolean usingProxy() { return connection.usingProxy(); }
public boolean usingProxy() { return connection.usingProxy(); }
@Override public boolean usingProxy() { return delegate.usingProxy(); }
@Override public boolean usingProxy() { return delegate.usingProxy(); }
@Override public boolean usingProxy() { return delegate.usingProxy(); }
@Override public boolean usingProxy() { return delegate.usingProxy(); }
private void printErrorStream(HttpURLConnection connection, int responseCode) throws IOException { boolean proxy = connection.usingProxy(); //this necessary, because we cannot access input stream if the response code is something like 404 try (InputStream in = responseCode < HttpURLConnection.HTTP_BAD_REQUEST ? connection.getInputStream() : connection.getErrorStream()) { logger.error("Received response: {} for {} using proxy?: {}", responseCode, connection.getURL(), proxy); try (BufferedReader reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))) { logger.error("Error stream: {}", CharStreams.toString(reader)); } } }
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress("10.10.100.100", 80)); HttpURLConnection connection = (HttpURLConnection)new URL("http://abc.abcd.com").openConnection(proxy); ((HttpURLConnection)new URL("http://abc.abcd.com").openConnection(proxy)).getInputStream(); System.out.println(connection.usingProxy());