| Modifier and Type | Field and Description |
|---|---|
| public static final String | AUTH_CONFIG
Authentication configuration. |
| public static final String | CREDENTIALS
Authentication credentials. |
| public static final String | HANDSHAKE_TIMEOUT
Property usable in |
| public static final String | INCOMING_BUFFER_SIZE
Property name for maximal incoming buffer size. |
| public static final String | LOG_HTTP_UPGRADE
User property to configure logging of HTTP upgrade messages. |
| public static final String | MASKING_KEY_GENERATOR
Property name for registering a custom masking key generator. |
| public static final String | PROXY_HEADERS
User property to set additional proxy headers. |
| public static final String | PROXY_URI
User property to set proxy URI. |
| public static final String | RECONNECT_HANDLER
Property usable in |
| public static final String | REDIRECT_ENABLED
HTTP Redirect support. |
| public static final String | REDIRECT_THRESHOLD
The maximal number of redirects during single handshake. |
| public static final String | RETRY_AFTER_SERVICE_UNAVAILABLE
HTTP Service Unavailable - Retry-After reconnect support. |
| public static final String | SHARED_CONTAINER
When set to |
| public static final String | SHARED_CONTAINER_IDLE_TIMEOUT
Container idle timeout in seconds ( |
| public static final String | SOCKET_BINDING
Property name for defining local binding address for all socket created by the client. |
| public static final String | SSL_ENGINE_CONFIGURATOR
Property usable in |
| public static final String | WORKER_THREAD_POOL_CONFIG
User property to set worker thread pool configuration. |
| Access | Constructor and Description |
|---|---|
| public |
| AUTH_CONFIG | back to summary |
|---|---|
| public static final String AUTH_CONFIG Authentication configuration. If no AuthConfig is specified then default configuration will be used, containing both Basic and Digest provided authenticators.
Value must be Sample below demonstrates how to use this property:
client.getProperties().put(ClientProperties.AUTH_CONFIG, AuthConfig.builder().enableProvidedBasicAuth()
.build());
| |
| CREDENTIALS | back to summary |
|---|---|
| public static final String CREDENTIALS Authentication credentials.
Value must be
Provided authenticators (both Basic and Digest) require this property set,
otherwise Sample below demonstrates how to use this property:
client.getProperties().put(ClientProperties.CREDENTIALS, new Credentials("websocket_user", "password");
| |
| HANDSHAKE_TIMEOUT | back to summary |
|---|---|
| public static final String HANDSHAKE_TIMEOUT Property usable in
Value must be | |
| INCOMING_BUFFER_SIZE | back to summary |
|---|---|
| public static final String INCOMING_BUFFER_SIZE Property name for maximal incoming buffer size.
Can be set in properties map (see | |
| LOG_HTTP_UPGRADE | back to summary |
|---|---|
| public static final String LOG_HTTP_UPGRADE User property to configure logging of HTTP upgrade messages.
Value is expected to be
When set to | |
| MASKING_KEY_GENERATOR | back to summary |
|---|---|
| public static final String MASKING_KEY_GENERATOR Property name for registering a custom masking key generator. The expected value is an instance of
As a security measure, all frames originating on websocket client have to be masked with random 4B value, which
should be freshly generated for each frame. Moreover to fully comply with the security requirements of RFC 6455,
a masking key of a frame must not be predictable from masking keys of previous frames and therefore Tyrus uses
This property allows replacing the default | |
| PROXY_HEADERS | back to summary |
|---|---|
| public static final String PROXY_HEADERS User property to set additional proxy headers.
Value is expected to be 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(ClientProperties.PROXY_HEADERS, proxyHeaders);
client.connectToServer(...);
Please note that these headers will be used only when establishing proxy connection, for modifying
WebSocket handshake headers, see
jakarta..
| |
| PROXY_URI | back to summary |
|---|---|
| public static final String PROXY_URI User property to set proxy URI.
Value is expected to be
client.getProperties().put(ClientProperties.PROXY_URI, "http://my.proxy.com:80");
client.connectToServer(...);
| |
| RECONNECT_HANDLER | back to summary |
|---|---|
| public static final String RECONNECT_HANDLER Property usable in
Value must be | |
| REDIRECT_ENABLED | back to summary |
|---|---|
| public static final String REDIRECT_ENABLED HTTP Redirect support.
Value is expected to be
When set to List of supported HTTP status codes:
| |
| REDIRECT_THRESHOLD | back to summary |
|---|---|
| public static final String REDIRECT_THRESHOLD The maximal number of redirects during single handshake.
Value is expected to be positive
HTTP redirection must be enabled by property
| |
| RETRY_AFTER_SERVICE_UNAVAILABLE | back to summary |
|---|---|
| public static final String RETRY_AFTER_SERVICE_UNAVAILABLE HTTP Service Unavailable - Retry-After reconnect support.
Value is expected to be
When set to Tyrus client will try to reconnect after this delay if:
| |
| SHARED_CONTAINER | back to summary |
|---|---|
| public static final String SHARED_CONTAINER When set to
A single thread pool is reused by all clients with this property set to
| |
| SHARED_CONTAINER_IDLE_TIMEOUT | back to summary |
|---|---|
| public static final String SHARED_CONTAINER_IDLE_TIMEOUT Container idle timeout in seconds ( When the timeout elapses, the shared thread pool will be destroyed.
| |
| SOCKET_BINDING | back to summary |
|---|---|
| public static final String SOCKET_BINDING Property name for defining local binding address for all socket created by the client. The expected value is an instance
of Sample below demonstrates how to use this property:
client.getProperties().put(ClientProperties.SOCKET_BINDING, InetAddress.getByName("127.0.0.1"));
| |
| SSL_ENGINE_CONFIGURATOR | back to summary |
|---|---|
| public static final String SSL_ENGINE_CONFIGURATOR Property usable in
Value is expected to be either
The advantage of using Example configuration for JDK client:
SslContextConfigurator sslContextConfigurator = new SslContextConfigurator();
sslContextConfigurator.setTrustStoreFile("...");
sslContextConfigurator.setTrustStorePassword("...");
sslContextConfigurator.setTrustStoreType("...");
sslContextConfigurator.setKeyStoreFile("...");
sslContextConfigurator.setKeyStorePassword("...");
sslContextConfigurator.setKeyStoreType("...");
SslEngineConfigurator sslEngineConfigurator = new SslEngineConfigurator(sslContextConfigurator, true,
false, false);
client.getProperties().put(ClientProperties.SSL_ENGINE_CONFIGURATOR, sslEngineConfigurator);
| |
| WORKER_THREAD_POOL_CONFIG | back to summary |
|---|---|
| public static final String WORKER_THREAD_POOL_CONFIG User property to set worker thread pool configuration.
An instance of Sample below demonstrates how to use this property:
client.getProperties().put(ClientProperties.WORKER_THREAD_POOL_CONFIG, ThreadPoolConfig.defaultConfig());
| |
| ClientProperties | back to summary |
|---|---|
| public ClientProperties() | |