Class WebSocketServerProtocolConfig.Builder
- java.lang.Object
-
- io.netty.handler.codec.http.websocketx.WebSocketServerProtocolConfig.Builder
-
- Enclosing class:
- WebSocketServerProtocolConfig
public static final class WebSocketServerProtocolConfig.Builder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
checkStartsWith
private WebSocketDecoderConfig
decoderConfig
private WebSocketDecoderConfig.Builder
decoderConfigBuilder
private boolean
dropPongFrames
private long
forceCloseTimeoutMillis
private boolean
handleCloseFrames
private long
handshakeTimeoutMillis
private WebSocketCloseStatus
sendCloseFrame
private java.lang.String
subprotocols
private java.lang.String
websocketPath
-
Constructor Summary
Constructors Modifier Constructor Description private
Builder(WebSocketServerProtocolConfig serverConfig)
private
Builder(java.lang.String websocketPath, java.lang.String subprotocols, boolean checkStartsWith, long handshakeTimeoutMillis, long forceCloseTimeoutMillis, boolean handleCloseFrames, WebSocketCloseStatus sendCloseFrame, boolean dropPongFrames, WebSocketDecoderConfig decoderConfig)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebSocketServerProtocolConfig.Builder
allowExtensions(boolean allowExtensions)
WebSocketServerProtocolConfig.Builder
allowMaskMismatch(boolean allowMaskMismatch)
WebSocketServerProtocolConfig
build()
Build unmodifiable server protocol configuration.WebSocketServerProtocolConfig.Builder
checkStartsWith(boolean checkStartsWith)
true
to handle all requests, where URI path component starts fromWebSocketServerProtocolConfig.websocketPath()
,false
for exact match (default).WebSocketServerProtocolConfig.Builder
closeOnProtocolViolation(boolean closeOnProtocolViolation)
WebSocketServerProtocolConfig.Builder
decoderConfig(WebSocketDecoderConfig decoderConfig)
Frames decoder configuration.private WebSocketDecoderConfig.Builder
decoderConfigBuilder()
WebSocketServerProtocolConfig.Builder
dropPongFrames(boolean dropPongFrames)
true
if pong frames should not be forwardedWebSocketServerProtocolConfig.Builder
expectMaskedFrames(boolean expectMaskedFrames)
WebSocketServerProtocolConfig.Builder
forceCloseTimeoutMillis(long forceCloseTimeoutMillis)
Close the connection if it was not closed by the client after timeout specifiedWebSocketServerProtocolConfig.Builder
handleCloseFrames(boolean handleCloseFrames)
true
if close frames should not be forwarded and just close the channelWebSocketServerProtocolConfig.Builder
handshakeTimeoutMillis(long handshakeTimeoutMillis)
Handshake timeout in mills, when handshake timeout, will trigger user eventWebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT
WebSocketServerProtocolConfig.Builder
maxFramePayloadLength(int maxFramePayloadLength)
WebSocketServerProtocolConfig.Builder
sendCloseFrame(WebSocketCloseStatus sendCloseFrame)
Close frame to send, when close frame was not send manually.WebSocketServerProtocolConfig.Builder
subprotocols(java.lang.String subprotocols)
CSV of supported protocolsWebSocketServerProtocolConfig.Builder
websocketPath(java.lang.String websocketPath)
URI path component to handle websocket upgrade requests on.WebSocketServerProtocolConfig.Builder
withUTF8Validator(boolean withUTF8Validator)
-
-
-
Field Detail
-
websocketPath
private java.lang.String websocketPath
-
subprotocols
private java.lang.String subprotocols
-
checkStartsWith
private boolean checkStartsWith
-
handshakeTimeoutMillis
private long handshakeTimeoutMillis
-
forceCloseTimeoutMillis
private long forceCloseTimeoutMillis
-
handleCloseFrames
private boolean handleCloseFrames
-
sendCloseFrame
private WebSocketCloseStatus sendCloseFrame
-
dropPongFrames
private boolean dropPongFrames
-
decoderConfig
private WebSocketDecoderConfig decoderConfig
-
decoderConfigBuilder
private WebSocketDecoderConfig.Builder decoderConfigBuilder
-
-
Constructor Detail
-
Builder
private Builder(WebSocketServerProtocolConfig serverConfig)
-
Builder
private Builder(java.lang.String websocketPath, java.lang.String subprotocols, boolean checkStartsWith, long handshakeTimeoutMillis, long forceCloseTimeoutMillis, boolean handleCloseFrames, WebSocketCloseStatus sendCloseFrame, boolean dropPongFrames, WebSocketDecoderConfig decoderConfig)
-
-
Method Detail
-
websocketPath
public WebSocketServerProtocolConfig.Builder websocketPath(java.lang.String websocketPath)
URI path component to handle websocket upgrade requests on.
-
subprotocols
public WebSocketServerProtocolConfig.Builder subprotocols(java.lang.String subprotocols)
CSV of supported protocols
-
checkStartsWith
public WebSocketServerProtocolConfig.Builder checkStartsWith(boolean checkStartsWith)
true
to handle all requests, where URI path component starts fromWebSocketServerProtocolConfig.websocketPath()
,false
for exact match (default).
-
handshakeTimeoutMillis
public WebSocketServerProtocolConfig.Builder handshakeTimeoutMillis(long handshakeTimeoutMillis)
Handshake timeout in mills, when handshake timeout, will trigger user eventWebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_TIMEOUT
-
forceCloseTimeoutMillis
public WebSocketServerProtocolConfig.Builder forceCloseTimeoutMillis(long forceCloseTimeoutMillis)
Close the connection if it was not closed by the client after timeout specified
-
handleCloseFrames
public WebSocketServerProtocolConfig.Builder handleCloseFrames(boolean handleCloseFrames)
true
if close frames should not be forwarded and just close the channel
-
sendCloseFrame
public WebSocketServerProtocolConfig.Builder sendCloseFrame(WebSocketCloseStatus sendCloseFrame)
Close frame to send, when close frame was not send manually. Ornull
to disable proper close.
-
dropPongFrames
public WebSocketServerProtocolConfig.Builder dropPongFrames(boolean dropPongFrames)
true
if pong frames should not be forwarded
-
decoderConfig
public WebSocketServerProtocolConfig.Builder decoderConfig(WebSocketDecoderConfig decoderConfig)
Frames decoder configuration.
-
decoderConfigBuilder
private WebSocketDecoderConfig.Builder decoderConfigBuilder()
-
maxFramePayloadLength
public WebSocketServerProtocolConfig.Builder maxFramePayloadLength(int maxFramePayloadLength)
-
expectMaskedFrames
public WebSocketServerProtocolConfig.Builder expectMaskedFrames(boolean expectMaskedFrames)
-
allowMaskMismatch
public WebSocketServerProtocolConfig.Builder allowMaskMismatch(boolean allowMaskMismatch)
-
allowExtensions
public WebSocketServerProtocolConfig.Builder allowExtensions(boolean allowExtensions)
-
closeOnProtocolViolation
public WebSocketServerProtocolConfig.Builder closeOnProtocolViolation(boolean closeOnProtocolViolation)
-
withUTF8Validator
public WebSocketServerProtocolConfig.Builder withUTF8Validator(boolean withUTF8Validator)
-
build
public WebSocketServerProtocolConfig build()
Build unmodifiable server protocol configuration.
-
-