Example usage for org.apache.commons.httpclient HttpConnection getProxyHost

List of usage examples for org.apache.commons.httpclient HttpConnection getProxyHost

Introduction

In this page you can find the example usage for org.apache.commons.httpclient HttpConnection getProxyHost.

Prototype

public String getProxyHost() 

Source Link

Document

Returns the proxy host.

Usage

From source file:com.exalead.io.failover.MonitoredHttpConnectionManager.java

/**
 * Gets the host configuration for a connection.
 * @param conn the connection to get the configuration of
 * @return a new HostConfiguration// w w w  .j  a  va 2  s . c o  m
 */
static HostConfiguration rebuildConfigurationFromConnection(HttpConnection conn) {
    HostConfiguration connectionConfiguration = new HostConfiguration();
    connectionConfiguration.setHost(conn.getHost(), conn.getPort(), conn.getProtocol());
    if (conn.getLocalAddress() != null) {
        connectionConfiguration.setLocalAddress(conn.getLocalAddress());
    }
    if (conn.getProxyHost() != null) {
        connectionConfiguration.setProxy(conn.getProxyHost(), conn.getProxyPort());
    }
    return connectionConfiguration;
}