Class WsUpgrader
java.lang.Object
io.helidon.nima.websocket.webserver.WsUpgrader
- All Implemented Interfaces:
Http1Upgrader
- Direct Known Subclasses:
TyrusUpgrader
Http1Upgrader implementation to upgrade from HTTP/1.1 to WebSocket.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Http.HeaderNameWebsocket protocol header name.static final Http.HeaderNameWebsocket protocol header name.protected static final StringSupported version.protected static final Http.HeaderValueSupported version header.protected static final StringSwitching response prefix.protected static final StringSwitching response suffix.static final Http.HeaderNameWebsocket key header name.static final Http.HeaderNameWebsocket version header name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanprotected Stringhash(ConnectionContext ctx, String wsKey) origins()Expected value of the protocol upgrade, such ash2c, orwebsocket.upgrade(ConnectionContext ctx, HttpPrologue prologue, WritableHeaders<?> headers) Upgrade connection.
-
Field Details
-
WS_KEY
Websocket key header name. -
WS_VERSION
Websocket version header name. -
PROTOCOL
Websocket protocol header name. -
EXTENSIONS
Websocket protocol header name. -
SWITCHING_PROTOCOL_PREFIX
Switching response prefix.- See Also:
-
SWITCHING_PROTOCOLS_SUFFIX
Switching response suffix.- See Also:
-
SUPPORTED_VERSION
Supported version.- See Also:
-
SUPPORTED_VERSION_HEADER
Supported version header.
-
-
Constructor Details
-
WsUpgrader
-
-
Method Details
-
supportedProtocol
Description copied from interface:Http1UpgraderExpected value of the protocol upgrade, such ash2c, orwebsocket. If an implementation supports multiple protocols, please implement this selector for each protocol- Specified by:
supportedProtocolin interfaceHttp1Upgrader- Returns:
- supported protocol
-
upgrade
public ServerConnection upgrade(ConnectionContext ctx, HttpPrologue prologue, WritableHeaders<?> headers) Description copied from interface:Http1UpgraderUpgrade connection.- Specified by:
upgradein interfaceHttp1Upgrader- Parameters:
ctx- connection contextprologue- http prologue of the upgrade requestheaders- http headers of the upgrade request- Returns:
- a new connection to use instead of the original
Http1Connection, ornullif the connection cannot be upgraded
-
anyOrigin
protected boolean anyOrigin() -
origins
-
hash
-