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.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.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
-
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
-