java.lang.Object
io.helidon.webclient.api.Proxy
A definition of a proxy server to use for outgoing requests.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFluent API builder forProxy.static enumType of the proxy. -
Method Summary
Modifier and TypeMethodDescriptionstatic Proxy.Builderbuilder()Fluent API builder for new instances.static Proxycreate()Create from environment and system properties.static ProxyCreate a new proxy instance from configuration.booleaninthashCode()host()Returns the host.booleanVerifies whether the current host is inside noHosts.booleanisUsingSystemProxy(String uri) Verifies whether the specified Uri is using system proxy.static ProxynoProxy()A Proxy instance that does not proxy requests.Optional<char[]> password()Returns an Optional with the password.intport()Returns the port.tcpSocket(WebClient webClient, InetSocketAddress inetSocketAddress, SocketOptions socketOptions, boolean tls) Create a socket for TCP, connected through the proxy.type()Get proxy type.username()Returns an Optional with the username.
-
Method Details
-
builder
Fluent API builder for new instances.- Returns:
- a new builder
-
noProxy
A Proxy instance that does not proxy requests.- Returns:
- a new instance with no proxy definition
-
create
Create a new proxy instance from configuration.proxy: http: uri: https://www.example.org https: uri: https://www.example.org no-proxy: ["*.example.org", "localhost"]- Parameters:
config- configuration, should be located on a key that has proxy as a subkey- Returns:
- proxy instance
-
create
Create from environment and system properties.- Returns:
- a proxy instance configured based on this system settings
-
tcpSocket
public Socket tcpSocket(WebClient webClient, InetSocketAddress inetSocketAddress, SocketOptions socketOptions, boolean tls) Create a socket for TCP, connected through the proxy.- Parameters:
webClient- web client to use if HTTP requests must be doneinetSocketAddress- target address of the request (proxy address is configured as part Proxy instance)socketOptions- options for creating socketstls- whether to use TLS- Returns:
- a new connected socket
-
type
Get proxy type.- Returns:
- the proxy type
-
isNoHosts
Verifies whether the current host is inside noHosts.- Parameters:
uri- the uri- Returns:
- true if it is in no hosts, otherwise false
-
isUsingSystemProxy
Verifies whether the specified Uri is using system proxy.- Parameters:
uri- the uri- Returns:
- true if the uri resource will be proxied
-
port
public int port()Returns the port.- Returns:
- proxy port
-
host
Returns the host.- Returns:
- proxy host
-
username
Returns an Optional with the username.- Returns:
- the username
-
password
Returns an Optional with the password.- Returns:
- the password
-
equals
-
hashCode
public int hashCode()
-