diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandler.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandler.java index 5be7842507..60a44c8318 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandler.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandler.java @@ -28,8 +28,16 @@ import io.netty.util.AttributeKey; import static io.netty.handler.codec.http.HttpVersion.*; /** - * Handles WebSocket control frames (Close, Ping, Pong) and data frames (Text and Binary) are passed - * to the next handler in the pipeline. + * This handler does all the heavy lifting for you to run a websocket server. + * + * It takes care of websocket handshaking as well as processing of control frames (Close, Ping, Pong). Text and Binary + * data frames are passed to the next handler in the pipeline (implemented by you) for processing. + * + * See io.netty.example.http.websocketx.html5.WebSocketServer for usage. + * + * The implementation of this handler assumes that you just want to run a websocket server and not process other types + * HTTP requests (like GET and POST). If you wish to support both HTTP requests and websockets in the one server, refer + * to the io.netty.example.http.websocketx.server.WebSocketServer example. */ public class WebSocketServerProtocolHandler extends ChannelInboundMessageHandlerAdapter { diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandshakeHandler.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandshakeHandler.java index 69833fc951..3f799dc75f 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandshakeHandler.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandshakeHandler.java @@ -29,16 +29,12 @@ import io.netty.handler.codec.http.HttpHeaders; import io.netty.handler.codec.http.HttpRequest; import io.netty.handler.codec.http.HttpResponse; import io.netty.handler.ssl.SslHandler; -import io.netty.logging.InternalLogger; -import io.netty.logging.InternalLoggerFactory; /** - * Handles the HTTP handshake (the HTTP Upgrade request) + * Handles the HTTP handshake (the HTTP Upgrade request) for {@link WebSocketServerProtocolHandler}. */ public class WebSocketServerProtocolHandshakeHandler extends ChannelInboundMessageHandlerAdapter { - private static final InternalLogger logger = - InternalLoggerFactory.getInstance(WebSocketServerProtocolHandshakeHandler.class); private final String websocketPath; private final String subprotocols; private final boolean allowExtensions;