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 SPEC
compress
(boolean compress) Sets flag whether the websocket compression extension is enabled if the client request presents websocket extensions headers.get()
final SPEC
handlePing
(boolean handlePing) Sets flag whether to proxy websocket ping frames or respond to them.final SPEC
maxFramePayloadLength
(int maxFramePayloadLength) Sets a custom maximum allowable frame payload length.final SPEC
Sets 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
-
get
- Specified by:
get
in interfaceSupplier<SPEC extends WebsocketSpec.Builder<SPEC>>
-