Package reactor.netty.http.websocket
Class WebsocketSpec.Builder<SPEC extends WebsocketSpec.Builder<SPEC>>
java.lang.Object
reactor.netty.http.websocket.WebsocketSpec.Builder<SPEC>
- All Implemented Interfaces:
Supplier<SPEC>
- Direct Known Subclasses:
WebsocketClientSpec.Builder,WebsocketServerSpec.Builder
- Enclosing interface:
- WebsocketSpec
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal SPECcompress(boolean compress) Sets flag whether the websocket compression extension is enabled if the client request presents websocket extensions headers.get()final SPEChandlePing(boolean handlePing) Sets flag whether to proxy websocket ping frames or respond to them.final SPECmaxDecompressionBufferSize(int maxDecompressionBufferSize) Configure the maximum allowed size, in bytes, of the buffer used to decompress a websocket message/frame when the compression extension is enabled.final SPECmaxFramePayloadLength(int maxFramePayloadLength) Sets a custom maximum allowable frame payload length.final SPECSets sub-protocol to use in websocket handshake signature.
-
Constructor Details
-
Builder
protected Builder()
-
-
Method Details
-
protocols
Sets sub-protocol to use in websocket handshake signature. Null by default.- Parameters:
protocols- sub-protocol- Returns:
- this
- Throws:
NullPointerException- if protocols is null
-
maxFramePayloadLength
Sets a custom maximum allowable frame payload length. 65536 by default.Note: When a websocket compression extension is enabled, this setting is applied on the compressed data.
- Parameters:
maxFramePayloadLength- maximum allowable frame payload length- Returns:
- this
- Throws:
IllegalArgumentException- if maxFramePayloadLength is negative
-
handlePing
Sets flag whether to proxy websocket ping frames or respond to them. False by default.- Parameters:
handlePing- whether to proxy websocket ping frames or respond to them- Returns:
- this
-
compress
Sets flag whether the websocket compression extension is enabled if the client request presents websocket extensions headers. By default, compression is disabled.- Parameters:
compress- whether the websocket compression extension is enabled if the client request presents websocket extensions headers.- Returns:
- this
-
maxDecompressionBufferSize
Configure the maximum allowed size, in bytes, of the buffer used to decompress a websocket message/frame when the compression extension is enabled. Defaults toDEFAULT_MAX_DECOMPRESSION_BUFFER_SIZE(0), which means that the maximum size is not limited.Note: This setting has no effect unless
compress(boolean)is enabled.- Parameters:
maxDecompressionBufferSize- the maximum allowed size of the decompression buffer, in bytes;0means the maximum size is not limited (non-negative)- Returns:
- this
- Throws:
IllegalArgumentException- if maxDecompressionBufferSize is negative- Since:
- 1.0.53
-
get
- Specified by:
getin interfaceSupplier<SPEC extends WebsocketSpec.Builder<SPEC>>
-