public class HTTPProxyConnector extends Object implements ProxyConnector
It is possible to connect through a proxy server via HTTP, even for non HTTP protocols.
Constructor and Description |
---|
HTTPProxyConnector()
Create a Proxy Connector with no properties set.
|
HTTPProxyConnector(String host,
int port)
Create a Proxy Connector with specified host and port.
|
Modifier and Type | Method and Description |
---|---|
SocketChannel |
doHandshake(ServerDetails serverDetails)
Implementations must provide this method to make a connection via a
Proxy server and return the SocketChannel.
|
int |
getConnectionTimeout() |
String |
getHost() |
int |
getPort() |
void |
setConnectionTimeout(int connectionTimeout)
Sets connectionTimeout.
|
void |
setHost(String host)
Sets host.
|
void |
setPort(int port)
Sets port.
|
public HTTPProxyConnector()
public HTTPProxyConnector(String host, int port)
host
- the proxy server hostport
- the proxy server portpublic final String getHost()
public final void setHost(String host)
host
- the host to setpublic final int getPort()
public void setPort(int port)
port
- the port to setpublic final int getConnectionTimeout()
public final void setConnectionTimeout(int connectionTimeout)
connectionTimeout
- the connectionTimeout to setpublic SocketChannel doHandshake(ServerDetails serverDetails) throws APIException
ProxyConnector
doHandshake
in interface ProxyConnector
serverDetails
- the server details specifying details of the
Diffusion server to connect to.AuthorisationException
- if connection is rejected. This will cause
an AuthorisationException to be propagated to the caller without
attempting to select another server.APIException
- if unable to establish a connection.Copyright © 2016 Push Technology Ltd. All Rights Reserved.