Class GrizzlyClientSocket
- java.lang.Object
-
- org.glassfish.tyrus.container.grizzly.client.GrizzlyClientSocket
-
public class GrizzlyClientSocket extends java.lang.Object
Implementation of the WebSocket interface.- Author:
- Stepan Kopriva (stepan.kopriva at oracle.com), Pavel Bucek (pavel.bucek at oracle.com)
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROXY_HEADERS
Deprecated.please useClientProperties.PROXY_HEADERS
static java.lang.String
PROXY_URI
Deprecated.please useClientProperties.PROXY_URI
.static java.lang.String
SELECTOR_THREAD_POOL_CONFIG
Deprecated.static java.lang.String
WORKER_THREAD_POOL_CONFIG
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connect()
Performs connect to server endpoint.
-
-
-
Field Detail
-
PROXY_URI
public static final java.lang.String PROXY_URI
Deprecated.please useClientProperties.PROXY_URI
.Client-side user property to set proxy URI.Value is expected to be
String
and represent proxy URI. Protocol part is currently ignored but must be present (URI(String)
is used for parsing).client.getProperties().put(GrizzlyClientSocket.PROXY_URI, "http://my.proxy.com:80"); client.connectToServer(...);
-
PROXY_HEADERS
public static final java.lang.String PROXY_HEADERS
Deprecated.please useClientProperties.PROXY_HEADERS
Client-side user property to set additional 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, seeClientEndpointConfig.Configurator.beforeRequest(java.util.Map)
.
-
WORKER_THREAD_POOL_CONFIG
public static final java.lang.String WORKER_THREAD_POOL_CONFIG
Deprecated.Client-side property to set custom workerThreadPoolConfig
.Value is expected to be instance of
ThreadPoolConfig
, can benull
(it won't be used).- See Also:
- Constant Field Values
-
SELECTOR_THREAD_POOL_CONFIG
public static final java.lang.String SELECTOR_THREAD_POOL_CONFIG
Deprecated.Client-side property to set custom selectorThreadPoolConfig
.Value is expected to be instance of
ThreadPoolConfig
, can benull
(it won't be used).- See Also:
- Constant Field Values
-
-
Method Detail
-
connect
public void connect() throws DeploymentException, java.io.IOException
Performs connect to server endpoint.- Throws:
DeploymentException
- when there the server endpoint cannot be reached.java.io.IOException
- when transport fails to start.
-
-