java.lang.Object
io.helidon.webserver.websocket.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 HeaderNameWebsocket protocol header name.static final HeaderNameWebsocket protocol header name.protected static final StringSupported version.protected static final HeaderSupported version header.protected static final StringSwitching response prefix.protected static final StringSwitching response suffix.static final HeaderNameWebsocket key header name.static final HeaderNameWebsocket version header name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic WsUpgraderWebSocket upgrader for HTTP/1.protected 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
-
create
WebSocket upgrader for HTTP/1.- Parameters:
config- configuration of web socket protocol- Returns:
- a new upgrader
-
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
-