Class ProxyOptions
java.lang.Object
io.vertx.core.net.ProxyOptions
Proxy options for a net client or a net client.
- Author:
- Alexander Lehmann
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ProxyOptions(JsonObject json) Create options from JSON.ProxyOptions(ProxyOptions other) Copy constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the connection timeout , defaults to10seconds.getHost()Get proxy host.Get proxy password.intgetPort()Get proxy port.Get the Proxy-Authorization header value.getType()Get proxy type.Get proxy username.setConnectTimeout(Duration connectTimeout) Set the connection timeout.Set proxy host.setPassword(String password) Set proxy password.setPort(int port) Set proxy port.setProxyAuthorization(String proxyAuthorization) Set the Proxy-Authorization header value.Set proxy type.setUsername(String username) Set proxy username.toJson()Convert to JSON
-
Field Details
-
DEFAULT_TYPE
The default proxy type (HTTP) -
DEFAULT_PORT
public static final int DEFAULT_PORTThe default port for proxy connect = 31283128 is the default port for Squid
- See Also:
-
DEFAULT_HOST
The default hostname for proxy connect = "localhost"- See Also:
-
DEFAULT_CONNECT_TIMEOUT
The default timeout for proxy connect = 10 seconds
-
-
Constructor Details
-
ProxyOptions
public ProxyOptions()Default constructor. -
ProxyOptions
-
ProxyOptions
-
-
Method Details
-
toJson
-
getHost
-
setHost
Set proxy host.- Parameters:
host- the proxy host to connect to- Returns:
- a reference to this, so the API can be used fluently
-
getPort
public int getPort()Get proxy port.- Returns:
- proxy port
-
setPort
Set proxy port.- Parameters:
port- the proxy port to connect to- Returns:
- a reference to this, so the API can be used fluently
-
getUsername
-
setUsername
Set proxy username.- Parameters:
username- the proxy username- Returns:
- a reference to this, so the API can be used fluently
-
getPassword
-
setPassword
Set proxy password.- Parameters:
password- the proxy password- Returns:
- a reference to this, so the API can be used fluently
-
getProxyAuthorization
Get the Proxy-Authorization header value.- Returns:
- the Proxy-Authorization header value
-
setProxyAuthorization
Set the Proxy-Authorization header value.When set, this value is sent instead of the Basic value derived from the username and password.
- Parameters:
proxyAuthorization- the Proxy-Authorization header value- Returns:
- a reference to this, so the API can be used fluently
-
getType
Get proxy type.ProxyType can be HTTP, SOCKS4 and SOCKS5
- Returns:
- proxy type
-
setType
Set proxy type.ProxyType can be HTTP, SOCKS4 and SOCKS5
- Parameters:
type- the proxy type to connect to- Returns:
- a reference to this, so the API can be used fluently
-
getConnectTimeout
Get the connection timeout , defaults to10seconds.A connection to the proxy is considered successful when:
- the client received a
200response to theCONNECTrequest for HTTP proxies, or - the
SOCKShandshake ended with theSUCCESSstatus, for SOCKS proxies.
- Returns:
- the connection timeout
- the client received a
-
setConnectTimeout
Set the connection timeout.- Parameters:
connectTimeout- the connection timeout- Returns:
- a reference to this, so the API can be used fluently
-