public class GrizzlyClientSocket extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PROXY_HEADERS
Deprecated.
please use
ClientProperties.PROXY_HEADERS |
static String |
PROXY_URI
Deprecated.
please use
ClientProperties.PROXY_URI . |
static String |
SELECTOR_THREAD_POOL_CONFIG
Deprecated.
|
static String |
WORKER_THREAD_POOL_CONFIG
Deprecated.
|
public static final String PROXY_URI
ClientProperties.PROXY_URI
.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(...);
EndpointConfig.getUserProperties()
,
Constant Field Valuespublic static final String PROXY_HEADERS
ClientProperties.PROXY_HEADERS
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 HashMapPlease note that these headers will be used only when establishing proxy connection, for modifying WebSocket handshake headers, seeproxyHeaders = new HashMap (); proxyHeaders.put("Proxy-Authorization", "Basic " + Base64Utils.encodeToString("username:password".getBytes(Charset.forName("UTF-8")),false)); client.getProperties().put(GrizzlyClientSocket.PROXY_HEADERS, proxyHeaders); client.connectToServer(...);
ClientEndpointConfig.Configurator.beforeRequest(java.util.Map)
.EndpointConfig.getUserProperties()
,
Constant Field Valuespublic static final 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 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 javax.websocket.DeploymentException, IOException
javax.websocket.DeploymentException
IOException
Copyright © 2012-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.