public static interface HttpServerUpgradeHandler.UpgradeCodec
Modifier and Type | Method and Description |
---|---|
void |
prepareUpgradeResponse(ChannelHandlerContext ctx,
FullHttpRequest upgradeRequest,
FullHttpResponse upgradeResponse)
Adds any headers to the 101 Switching protocols response that are appropriate for this protocol.
|
String |
protocol()
Returns the name of the protocol supported by this codec, as indicated by the
HttpHeaderNames.UPGRADE header. |
Collection<String> |
requiredUpgradeHeaders()
Gets all protocol-specific headers required by this protocol for a successful upgrade.
|
void |
upgradeTo(ChannelHandlerContext ctx,
FullHttpRequest upgradeRequest,
FullHttpResponse upgradeResponse)
Performs an HTTP protocol upgrade from the source codec.
|
String protocol()
HttpHeaderNames.UPGRADE
header.Collection<String> requiredUpgradeHeaders()
HttpHeaderNames.CONNECTION
header as well.void prepareUpgradeResponse(ChannelHandlerContext ctx, FullHttpRequest upgradeRequest, FullHttpResponse upgradeResponse)
void upgradeTo(ChannelHandlerContext ctx, FullHttpRequest upgradeRequest, FullHttpResponse upgradeResponse)
ctx
- the context for the current handler.upgradeRequest
- the request that triggered the upgrade to this protocol. The
upgraded protocol is responsible for sending the response.upgradeResponse
- a 101 Switching Protocols response that is populated with the
HttpHeaderNames.CONNECTION
and HttpHeaderNames.UPGRADE
headers.
The protocol is required to send this before sending any other frames back to the client.
The headers may be augmented as necessary by the protocol before sending.Copyright © 2008–2015 The Netty Project. All rights reserved.