public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
Object msg = e.getMessage();
if (msg instanceof CloseWebSocketFrame) {
ctx.getChannel().close();
} else if (msg instanceof TextWebSocketFrame) {
TextWebSocketFrame frame = (TextWebSocketFrame) msg;
receivePackets(ctx, frame.getBinaryData());
} else if (msg instanceof HttpRequest) {
HttpRequest req = (HttpRequest) msg;
QueryStringDecoder queryDecoder = new QueryStringDecoder(req.getUri());
String path = queryDecoder.getPath();
if (path.startsWith(this.path)) {