From a9bd9699a49ee79602414e9ee9a88da42bcd371b Mon Sep 17 00:00:00 2001 From: Matthias Einwag Date: Wed, 22 Oct 2014 20:18:00 +0200 Subject: [PATCH] Fix the websocket server example Motivation: As report in #2953 the websocket server example contained a bug and did therefore not work with chrome: A websocket extension is added to the pipeline but extensions were disallowed in the handshaker and decoder, which is leading the decoder to closing the connection after receiving an extension frame. Modifications: Allow websocket extensions in the handshaker to correctly enable the extension. Result: Working websocket server example Fixes #2953 --- .../example/http/websocketx/server/WebSocketServerHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/src/main/java/io/netty/example/http/websocketx/server/WebSocketServerHandler.java b/example/src/main/java/io/netty/example/http/websocketx/server/WebSocketServerHandler.java index 345795a85a..87cd00482f 100644 --- a/example/src/main/java/io/netty/example/http/websocketx/server/WebSocketServerHandler.java +++ b/example/src/main/java/io/netty/example/http/websocketx/server/WebSocketServerHandler.java @@ -94,7 +94,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler // Handshake WebSocketServerHandshakerFactory wsFactory = new WebSocketServerHandshakerFactory( - getWebSocketLocation(req), null, false); + getWebSocketLocation(req), null, true); handshaker = wsFactory.newHandshaker(req); if (handshaker == null) { WebSocketServerHandshakerFactory.sendUnsupportedVersionResponse(ctx.channel());