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
Modifier and TypeFieldDescriptionstatic final HeaderName
Websocket protocol header name.static final HeaderName
Websocket protocol header name.protected static final String
Supported version.protected static final Header
Supported version header.protected static final String
Switching response prefix.protected static final String
Switching response suffix.static final HeaderName
Websocket key header name.static final HeaderName
Websocket version header name. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
static WsUpgrader
WebSocket upgrader for HTTP/1.protected String
hash
(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:Http1Upgrader
Expected value of the protocol upgrade, such ash2c
, orwebsocket
. If an implementation supports multiple protocols, please implement this selector for each protocol- Specified by:
supportedProtocol
in interfaceHttp1Upgrader
- Returns:
- supported protocol
-
upgrade
public ServerConnection upgrade(ConnectionContext ctx, HttpPrologue prologue, WritableHeaders<?> headers) Description copied from interface:Http1Upgrader
Upgrade connection.- Specified by:
upgrade
in 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
, ornull
if the connection cannot be upgraded
-
anyOrigin
protected boolean anyOrigin() -
origins
-
hash
-