permessage-deflate is stable, usable, and enabled by default starting on Jetty 9.3.0+
Please upgrade. Joakim Erdfelt / [email protected] On Fri, Oct 23, 2015 at 3:19 AM, Mike McTernan (wavemobile) < [email protected]> wrote: > Hi Folks, > > > > I’m using Jetty 9.2.13.v20150730 in an embedded setup, and wish to test > out websocket compression. I know that historically the standard hasn’t > been stable, and there have been some implementation bugs, but it looks > like things have been fixed and some time has passed. I figure that > testing is the way forward. > > > > Looking at websocket upgrade request and response headers in wireshark, it > looks like permessage-deflate is being offered by Chrome, but being ignored > by Jetty. I think this is because of this bug and change which disabled > the websocket extensions by default: > > > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=431459 > > > http://git.eclipse.org/c/jetty/org.eclipse.jetty.project.git/commit/?h=jetty-9.1.x&id=bfbd2a7d8f18b57f2b527b6d07949d41dfd6e31d > > > > I’d like to re-enable those extensions, but don’t know quite how to > achieve this and can’t find a good reference. From the above bug, it > suggests the following: > > > > “public void configure(WebSocketServletFactory factory) > > { > > factory.getExtensionFactory().register( > > "permessage-deflate",PerMessageDeflateExtension.class); > > factory.register(MySocket.class) > > } > > > > This applies to use of websocket via the WebSocketServlet (or > WebSocketHandler), using the Jetty WebSocket API.” > > > > However, in my setup I’m not extending a WebSocketServlet, instead I’m > using annotated POJOs which use @OnOpen, @OnMessage etc… to handle the > websocket messages very nicely. Therefore I’m not sure how or where I can > access the WebsocketServerFactory to get at the ExtensionFactory to make > the required registrations. > > > > I configure the server like this: > > > > Server server = new Server(PORT); > > WebAppContext wac = new WebAppContext(warFile.getAbsolutePath(), > "/"); > > > > ClassList classlist = ClassList.setServerDefault(server); > > > classlist.addBefore("org.eclipse.jetty.webapp.JettyWebXmlConfiguration", > "org.eclipse.jetty.annotations.AnnotationConfiguration"); > > > > > > wac.setAttribute("org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern", > > > ".*/[^/]*servlet-api-[^/]*\\.jar$|.*/javax.servlet.jsp.jstl-.*\\.jar$|.*/[^/]*taglibs.*\\.jar$"); > > > > ServerContainer wscontainer = > WebSocketServerContainerInitializer.configureContext(wac); > > > > wscontainer.addEndpoint(MyDataSourceWebSocketServlet.class); > > > > server.start(); > > > > Any pointers or suggestions would be gratefully received. > > > > Kind Regards, > > > > Mike > > > > _______________________________________________ > jetty-users mailing list > [email protected] > To change your delivery options, retrieve your password, or unsubscribe > from this list, visit > https://dev.eclipse.org/mailman/listinfo/jetty-users >
_______________________________________________ jetty-users mailing list [email protected] To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/jetty-users
