Class ProxyClient
java.lang.Object
org.apache.commons.httpclient.ProxyClient
A client that provides
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.- Since:
- 3.0
- Version:
- $Revision: 480424 $
- Author:
- Oleg Kalnichevski, Michael Becke
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContains the method used to execute the connect along with the created socket. -
Constructor Summary
ConstructorsConstructorDescriptionCreates an instance of ProxyClient using defaultparameter set.ProxyClient(HttpClientParams params) Creates an instance of ProxyClient using the givenparameter set. -
Method Summary
Modifier and TypeMethodDescriptionconnect()Creates a socket that is connected, via the HTTP CONNECT method, to a proxy.Returns thehost configurationassociated with the ProxyClient.ReturnsHTTP protocol parametersassociated with this ProxyClient.getState()ReturnsHTTP stateassociated with the ProxyClient.voidsetHostConfiguration(HostConfiguration hostConfiguration) Assigns thehost configurationto use with the ProxyClient.voidsetParams(HttpClientParams params) AssignsHTTP protocol parametersfor this ProxyClient.voidAssignsHTTP statefor the ProxyClient.
-
Constructor Details
-
ProxyClient
-
ProxyClient
Creates an instance of ProxyClient using the givenparameter set.- Parameters:
params- Theparametersto use.- See Also:
-
-
Method Details
-
getState
ReturnsHTTP stateassociated with the ProxyClient.- Returns:
- the shared client state
- See Also:
-
setState
AssignsHTTP statefor the ProxyClient.- Parameters:
state- the newHTTP statefor the client- See Also:
-
getHostConfiguration
Returns thehost configurationassociated with the ProxyClient.- Returns:
host configuration
-
setHostConfiguration
Assigns thehost configurationto use with the ProxyClient.- Parameters:
hostConfiguration- Thehost configurationto set
-
getParams
ReturnsHTTP protocol parametersassociated with this ProxyClient.- See Also:
-
setParams
AssignsHTTP protocol parametersfor this ProxyClient.- See Also:
-
connect
Creates a socket that is connected, via the HTTP CONNECT method, to a proxy.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 configurationprior to calling this method.- Returns:
- the connect response
- Throws:
IOExceptionHttpException- See Also:
-