public interface ClientServiceConfig extends Config
This is the configuration for the (optional) client service within a
Web Server configuration
. The client service handles
Diffusion client connections.
These properties may only be be set before a Diffusion Server is started.
Modifier and Type | Method and Description |
---|---|
String |
getCORSOrigin()
Gets the CORS origin value.
|
int |
getMaximumInboundRequestSize()
Gets the maximum inbound request size.
|
long |
getMessageSequenceTimeout()
Gets the message sequence timeout.
|
String |
getName()
Gets the service name.
|
String |
getWebsocketOrigin()
Gets the WebSocket origin pattern.
|
boolean |
isCookieDisabled()
Is the session cookie disabled?
|
boolean |
isDebug()
Is debug set?
|
void |
setCookieDisabled(boolean disabled)
Sets the session cookie as enabled/disabled.
|
void |
setCORSOrigin(String origin)
Sets the CORS origin.
|
void |
setDebug(boolean debug)
Sets debug.
|
void |
setMaximumInboundRequestSize(int maxSize)
Sets the maximum inbound request size.
|
void |
setMessageSequenceTimeout(long timeout)
Sets the message sequence timeout.
|
void |
setWebsocketOrigin(String origin)
Sets the WebSocket origin patten.
|
String getName()
void setMessageSequenceTimeout(long timeout) throws ConfigException
This is used with HTTP clients to indicate how long to wait for a missing message in a sequence of messages before assuming it is lost and closing the client session.
If not specified, a default value of 4 seconds is used.
timeout
- value in milliseconds. If this exceeds one hour (3600000
ms), a warning will be logged and the timeout will be set to one
hour.ConfigException
- if unable to set the propertylong getMessageSequenceTimeout()
void setWebsocketOrigin(String origin) throws ConfigException
The server will reject a WebSocket connection upgrade request that has an Origin header if the header does not match this regular expression.
The default value is ".*", which allows all WebSocket upgrade requests.
origin
- the web socket origin regular expressionConfigException
- if unable to set the propertyString getWebsocketOrigin()
void setCORSOrigin(String origin) throws ConfigException
This is used to control access from client web (XHR) to diffusion. This element will enable Cross Origin Resource Sharing. This is a REGEX pattern that will match the origin of the request. ".*" matches anything so all requests are allowed.
If this is not explicitly set, the service will not be able to handle CORS requests
origin
- the CORS originConfigException
- if unable to set the propertyString getCORSOrigin()
void setMaximumInboundRequestSize(int maxSize) throws ConfigException
The maximum number of bytes that the HTTP request can have.
A value of zero (the default) indicates that the maximum message size will be used.
maxSize
- size in bytesConfigException
- if unable to set the propertyint getMaximumInboundRequestSize()
void setCookieDisabled(boolean disabled) throws ConfigException
disabled
- set cookie as enabled/disabledConfigException
- if unable to set the propertyboolean isCookieDisabled()
void setDebug(boolean debug)
Default is false.
debug
- set debug on or offboolean isDebug()
Copyright © 2021 Push Technology Ltd. All Rights Reserved.