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

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

Introduction

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

Prototype

public int getProxyPort() 

Source Link

Document

Returns the port of 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/*from  w  ww  .jav a 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;
}