public class GrizzlyClientSocket
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PROXY_HEADERS
Deprecated.
please use
ClientProperties.PROXY_HEADERS |
static java.lang.String |
PROXY_URI
Deprecated.
please use
ClientProperties.PROXY_URI . |
static java.lang.String |
SELECTOR_THREAD_POOL_CONFIG
Deprecated.
please use
.GrizzlyClientProperties#SELECTOR_THREAD_POOL_CONFIG . |
static java.lang.String |
WORKER_THREAD_POOL_CONFIG
Deprecated.
please use
.GrizzlyClientProperties#WORKER_THREAD_POOL_CONFIG . |
Modifier and Type | Method and Description |
---|---|
void |
connect()
Performs connect to server endpoint.
|
public static final java.lang.String PROXY_URI
ClientProperties.PROXY_URI
.
Value is expected to be String
and represent proxy URI. Protocol part is currently ignored
but must be present (URI.URI(String)
is used for parsing).
client.getProperties().put(GrizzlyClientSocket.PROXY_URI, "http://my.proxy.com:80"); client.connectToServer(...);
public static final java.lang.String PROXY_HEADERS
ClientProperties.PROXY_HEADERS
Value is expected to be Map
<String
, String
> and represent raw http headers
to be added to initial request which is sent to proxy. Key corresponds to header name, value is header
value.
Sample below demonstrates use of this feature to set preemptive basic proxy authentication:
final HashMap<String, String> proxyHeaders = new HashMap<String, String>(); proxyHeaders.put("Proxy-Authorization", "Basic " + Base64.getEncoder().encodeToString("username:password".getBytes(Charset.forName("UTF-8")))); client.getProperties().put(GrizzlyClientSocket.PROXY_HEADERS, proxyHeaders); client.connectToServer(...);Please note that these headers will be used only when establishing proxy connection, for modifying WebSocket handshake headers, see
ClientEndpointConfig.Configurator.beforeRequest(java.util.Map)
.public static final java.lang.String WORKER_THREAD_POOL_CONFIG
.GrizzlyClientProperties#WORKER_THREAD_POOL_CONFIG
.ThreadPoolConfig
.
Value is expected to be instance of ThreadPoolConfig
, can be null
(it won't be used).
public static final java.lang.String SELECTOR_THREAD_POOL_CONFIG
.GrizzlyClientProperties#SELECTOR_THREAD_POOL_CONFIG
.ThreadPoolConfig
.
Value is expected to be instance of ThreadPoolConfig
, can be null
(it won't be used).
public void connect() throws DeploymentException, java.io.IOException
DeploymentException
- when there the server endpoint cannot be reached.java.io.IOException
- when transport fails to start.Copyright © 2012–2020 Oracle Corporation. All rights reserved.