Class WebSocketServiceBuilder
java.lang.Object
com.linecorp.armeria.server.websocket.WebSocketServiceBuilder
Builds a
WebSocketService
.
This service has the different default configs from a normal HttpService
. Here are the differences:
-
Method Summary
Modifier and TypeMethodDescriptionallowedOrigins
(Iterable<String> allowedOrigins) Sets the allowed origins.allowedOrigins
(String... allowedOrigins) Sets the allowed origins.allowMaskMismatch
(boolean allowMaskMismatch) Sets whether the decoder allows to loosen the masking requirement on received frames.build()
Returns a newly-createdWebSocketService
with the properties set so far.maxFramePayloadLength
(int maxFramePayloadLength) Sets the maximum length of a frame's payload.subprotocols
(Iterable<String> subprotocols) Sets the subprotocols to use with the WebSocket Protocol.subprotocols
(String... subprotocols) Sets the subprotocols to use with the WebSocket Protocol.
-
Method Details
-
maxFramePayloadLength
Sets the maximum length of a frame's payload. If the size of a payload data exceeds the value,WebSocketCloseStatus.MESSAGE_TOO_BIG
is sent to the peer. 65535 is used by default. -
allowMaskMismatch
Sets whether the decoder allows to loosen the masking requirement on received frames. It's not allowed by default. -
subprotocols
Sets the subprotocols to use with the WebSocket Protocol. -
subprotocols
Sets the subprotocols to use with the WebSocket Protocol. -
allowedOrigins
Sets the allowed origins. The same-origin is allowed by default. Specify "*" to allow any origins.- See Also:
-
allowedOrigins
Sets the allowed origins. The same-origin is allowed by default. Specify "*" to allow any origins.- See Also:
-
build
Returns a newly-createdWebSocketService
with the properties set so far.
-