public interface IWebSocketSessionConfig extends ISessionConfig
Modifier and Type | Field and Description |
---|---|
static String |
HANDSHAKE_DECODER
The default key identifying the handshake decoder
HandshakeDecoder in
the default codec pipeline created by the SNF4J framework. |
static String |
HANDSHAKE_ENCODER
The default key identifying the handshake encoder
HandshakeEncoder in
the default codec pipeline created by the SNF4J framework. |
static String |
WEBSOCKET_DECODER
The default key identifying the Web Socket frame decoder
FrameDecoder in
the default codec pipeline created by the SNF4J framework. |
static String |
WEBSOCKET_ENCODER
The default key identifying the Web Socket frame encoder
FrameEncoder in
the default codec pipeline created by the SNF4J framework. |
static String |
WEBSOCKET_UTF8_VALIDATOR
The default key identifying the UTF8 validator
FrameUtf8Validator in
the default codec pipeline created by the SNF4J framework. |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptRequestUri(URI requestUri)
Determines if a received Web Socket handshake request with given request URI
should be accepted by the server session associated with this configuration
object.
|
void |
customizeHeaders(HandshakeRequest request)
Called when the Web Socket handshake request is ready to be sent and can be
now customized, if needed.
|
void |
customizeHeaders(HandshakeResponse response)
Called when the Web Socket handshake response is ready to be sent and can be
now customized, if needed.
|
int |
getMaxFramePayloadLength()
Determines the maximum length of the payload in the decoded Web Socket
frames.
|
int |
getMaxHandshakeFrameLength()
Determines the maximum length of the decoded Web Socket handshake frames.
|
String |
getRequestOrigin()
Determines the value of the Origin header field in the client Web Socket
handshake request.
|
URI |
getRequestUri()
Determines the request URI (the server endpoint) in the client Web Socket
handshake request.
|
IExtension[] |
getSupportedExtensions()
Determines the supported extensions for both the server and client
Web Socket sessions.
|
String[] |
getSupportedSubProtocols()
Determines the names of supported subprotocols for both the server and client
Web Socket sessions.
|
boolean |
handleCloseFrame()
Determines if the received Web Socket close frames should be handled
automatically.
|
boolean |
ignoreHostHeaderField()
Determines if the server session associated with this configuration object
should ignore missing the Host header field in the received Web Socket
handshake request.
|
void |
switchDecoders(ICodecPipeline pipeline,
boolean allowExtensions)
Called when the decoders in the codec pipeline should be switched after
finishing of the Web Socket handshake.
|
void |
switchEncoders(ICodecPipeline pipeline,
boolean allowExtensions)
Called when the encoders in the codec pipeline should be switched after
finishing of the Web Socket handshake.
|
alwaysNotifiedBeingInPipeline, createCodecExecutor, createSSLEngine, createSSLEngine, getDatagramServerSessionNoReopenPeriod, getEndingAction, getEngineHandshakeTimeout, getMaxInBufferCapacity, getMaxSSLApplicationBufferSizeRatio, getMaxSSLNetworkBufferSizeRatio, getMaxWriteSpinCount, getMinInBufferCapacity, getMinOutBufferCapacity, getThroughputCalculationInterval, ignorePossiblyIncompleteDatagrams, optimizeDataCopying, waitForInboundCloseMessage
static final String HANDSHAKE_DECODER
HandshakeDecoder
in
the default codec pipeline created by the SNF4J framework.static final String HANDSHAKE_ENCODER
HandshakeEncoder
in
the default codec pipeline created by the SNF4J framework.static final String WEBSOCKET_DECODER
FrameDecoder
in
the default codec pipeline created by the SNF4J framework.static final String WEBSOCKET_ENCODER
FrameEncoder
in
the default codec pipeline created by the SNF4J framework.static final String WEBSOCKET_UTF8_VALIDATOR
FrameUtf8Validator
in
the default codec pipeline created by the SNF4J framework.URI getRequestUri()
It is not used for configuration of server sessions.
String getRequestOrigin()
It is not used for configuration of server sessions.
null
if the Origin
field is not required in the request.String[] getSupportedSubProtocols()
IExtension[] getSupportedExtensions()
void switchEncoders(ICodecPipeline pipeline, boolean allowExtensions)
pipeline
- the codec pipeline to be changedallowExtensions
- informs that some extensions have been negotiated
during the Web Socket handshakevoid switchDecoders(ICodecPipeline pipeline, boolean allowExtensions)
pipeline
- the codec pipeline to be changedallowExtensions
- informs that some extensions have been negotiated
during the Web Socket handshakevoid customizeHeaders(HandshakeRequest request)
request
- the handshake request to be sentvoid customizeHeaders(HandshakeResponse response)
response
- the handshake response to be sentboolean ignoreHostHeaderField()
true
to ignore missing the Host header fieldboolean acceptRequestUri(URI requestUri)
The requestUri
argument is built based on the Host header field
and the "Request-URI" of the GET method. If the Host header field is missed and the
ignoreHostHeaderField()
returns true
the host-port part of the
URI will be set to the "null" string.
requestUri
- the request URI in the received Web Socket handshake
requesttrue
if the request URI should be acceptedint getMaxHandshakeFrameLength()
int getMaxFramePayloadLength()
boolean handleCloseFrame()
true
if the close frames should be handled automaticallyCopyright © 2017–2022 SNF4J.ORG. All rights reserved.