public class ProxyClient extends Object
sockets for communicating through HTTP proxies
via the HTTP CONNECT method. This is primarily needed for non-HTTP protocols that wish to
communicate via an HTTP proxy.| 限定符和类型 | 类和说明 |
|---|---|
static class |
ProxyClient.ConnectResponse
Contains the method used to execute the connect along with the created socket.
|
| 构造器和说明 |
|---|
ProxyClient()
Creates an instance of ProxyClient using default
parameter set. |
ProxyClient(HttpClientParams params)
Creates an instance of ProxyClient using the given
parameter set. |
| 限定符和类型 | 方法和说明 |
|---|---|
ProxyClient.ConnectResponse |
connect()
Creates a socket that is connected, via the HTTP CONNECT method, to a proxy.
|
HostConfiguration |
getHostConfiguration()
Returns the
host configuration associated with the
ProxyClient. |
HttpClientParams |
getParams()
Returns
HTTP protocol parameters associated with this ProxyClient. |
HttpState |
getState()
Returns
HTTP state associated with the ProxyClient. |
void |
setHostConfiguration(HostConfiguration hostConfiguration)
Assigns the
host configuration to use with the
ProxyClient. |
void |
setParams(HttpClientParams params)
Assigns
HTTP protocol parameters for this ProxyClient. |
void |
setState(HttpState state)
Assigns
HTTP state for the ProxyClient. |
public ProxyClient()
parameter set.HttpClientParamspublic ProxyClient(HttpClientParams params)
parameter set.params - The parameters to use.HttpClientParamspublic HttpState getState()
HTTP state associated with the ProxyClient.setState(HttpState)public void setState(HttpState state)
HTTP state for the ProxyClient.state - the new HTTP state for the clientgetState()public HostConfiguration getHostConfiguration()
host configuration associated with the
ProxyClient.public void setHostConfiguration(HostConfiguration hostConfiguration)
host configuration to use with the
ProxyClient.hostConfiguration - The host configuration to setpublic HttpClientParams getParams()
HTTP protocol parameters associated with this ProxyClient.HttpClientParamspublic void setParams(HttpClientParams params)
HTTP protocol parameters for this ProxyClient.HttpClientParamspublic ProxyClient.ConnectResponse connect() throws IOException, HttpException
Even though HTTP CONNECT proxying is generally used for HTTPS tunneling, the returned socket will not have been wrapped in an SSL socket.
Both the proxy and destination hosts must be set via the
host configuration prior to calling this method.
IOExceptionHttpExceptiongetHostConfiguration()Copyright © 2017. All rights reserved.