public class HTTPProxyData extends Object implements ProxyData
HTTPProxyData
object is used to specify the needed connection data
to connect through a HTTP proxy.Connection.setProxyData(ProxyData)
Modifier and Type | Field and Description |
---|---|
String |
proxyHost |
String |
proxyPass |
int |
proxyPort |
String |
proxyUser |
String[] |
requestHeaderLines |
Constructor and Description |
---|
HTTPProxyData(String proxyHost,
int proxyPort)
Same as calling
HTTPProxyData(proxyHost, proxyPort, |
HTTPProxyData(String proxyHost,
int proxyPort,
String proxyUser,
String proxyPass)
Same as calling
HTTPProxyData(proxyHost, proxyPort, |
HTTPProxyData(String proxyHost,
int proxyPort,
String proxyUser,
String proxyPass,
String[] requestHeaderLines)
Connection data for a HTTP proxy.
|
public final String proxyHost
public final int proxyPort
public final String proxyUser
public final String proxyPass
public final String[] requestHeaderLines
public HTTPProxyData(String proxyHost, int proxyPort)
HTTPProxyData(proxyHost, proxyPort, null
, null
)
proxyHost
- Proxy hostname.proxyPort
- Proxy port.public HTTPProxyData(String proxyHost, int proxyPort, String proxyUser, String proxyPass)
HTTPProxyData(proxyHost, proxyPort, null
, null
, null
)
proxyHost
- Proxy hostname.proxyPort
- Proxy port.proxyUser
- Username for basic authentication (null
if no authentication is needed).proxyPass
- Password for basic authentication (null
if no authentication is needed).public HTTPProxyData(String proxyHost, int proxyPort, String proxyUser, String proxyPass, String[] requestHeaderLines)
Please note: if you want to use basic authentication, then both proxyUser
and proxyPass
must be non-null.
Here is an example:
new HTTPProxyData("192.168.1.1", "3128", "proxyuser", "secret", new String[] {"User-Agent: TrileadBasedClient/1.0", "X-My-Proxy-Option: something"});
proxyHost
- Proxy hostname.proxyPort
- Proxy port.proxyUser
- Username for basic authentication (null
if no authentication is needed).proxyPass
- Password for basic authentication (null
if no authentication is needed).requestHeaderLines
- An array with additional request header lines (without end-of-line markers)
that have to be sent to the server. May be null
.Copyright © 2021. All rights reserved.