Rename WebSocketServerHandshakeHandler to WebSocketServerProtocolHnadshakeHandler and also make it public. See #587
This commit is contained in:
parent
4353aa6794
commit
6e39192462
@ -54,8 +54,8 @@ public class WebSocketServerProtocolHandler extends ChannelInboundMessageHandler
|
|||||||
@Override
|
@Override
|
||||||
public void afterAdd(ChannelHandlerContext ctx) {
|
public void afterAdd(ChannelHandlerContext ctx) {
|
||||||
// Add the WebSocketHandshakeHandler before this one.
|
// Add the WebSocketHandshakeHandler before this one.
|
||||||
ctx.pipeline().addBefore(ctx.name(), WebSocketServerHandshakeHandler.class.getName(),
|
ctx.pipeline().addBefore(ctx.name(), WebSocketServerProtocolHandshakeHandler.class.getName(),
|
||||||
new WebSocketServerHandshakeHandler(websocketPath, subprotocols, allowExtensions));
|
new WebSocketServerProtocolHandshakeHandler(websocketPath, subprotocols, allowExtensions));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -35,15 +35,15 @@ import io.netty.logging.InternalLoggerFactory;
|
|||||||
/**
|
/**
|
||||||
* Handles the HTTP handshake (the HTTP Upgrade request)
|
* Handles the HTTP handshake (the HTTP Upgrade request)
|
||||||
*/
|
*/
|
||||||
class WebSocketServerHandshakeHandler extends ChannelInboundMessageHandlerAdapter<HttpRequest> {
|
public class WebSocketServerProtocolHandshakeHandler extends ChannelInboundMessageHandlerAdapter<HttpRequest> {
|
||||||
|
|
||||||
private static final InternalLogger logger =
|
private static final InternalLogger logger =
|
||||||
InternalLoggerFactory.getInstance(WebSocketServerHandshakeHandler.class);
|
InternalLoggerFactory.getInstance(WebSocketServerProtocolHandshakeHandler.class);
|
||||||
private final String websocketPath;
|
private final String websocketPath;
|
||||||
private final String subprotocols;
|
private final String subprotocols;
|
||||||
private final boolean allowExtensions;
|
private final boolean allowExtensions;
|
||||||
|
|
||||||
public WebSocketServerHandshakeHandler(String websocketPath, String subprotocols, boolean allowExtensions) {
|
public WebSocketServerProtocolHandshakeHandler(String websocketPath, String subprotocols, boolean allowExtensions) {
|
||||||
this.websocketPath = websocketPath;
|
this.websocketPath = websocketPath;
|
||||||
this.subprotocols = subprotocols;
|
this.subprotocols = subprotocols;
|
||||||
this.allowExtensions = allowExtensions;
|
this.allowExtensions = allowExtensions;
|
@ -44,7 +44,7 @@ public class WebSocketServerProtocolHandlerTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testHttpUpgradeRequest() throws Exception {
|
public void testHttpUpgradeRequest() throws Exception {
|
||||||
EmbeddedMessageChannel ch = createChannel(new MockOutboundHandler());
|
EmbeddedMessageChannel ch = createChannel(new MockOutboundHandler());
|
||||||
ChannelHandlerContext handshakerCtx = ch.pipeline().context(WebSocketServerHandshakeHandler.class);
|
ChannelHandlerContext handshakerCtx = ch.pipeline().context(WebSocketServerProtocolHandshakeHandler.class);
|
||||||
|
|
||||||
writeUpgradeRequest(ch);
|
writeUpgradeRequest(ch);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user