Search code examples
javaiostomcatwebsockettomcat8

PocketSocket fails to process incoming message


I'm trying to setup a websocket connection between an ios device and a tomcat webserver using the builtin websocket support in tomcat and PocketSocket on the iOS side.

Setting up the connection and sending data from the client to the server works fine but sending data from the server to client fails on the client side with the following error message:

Data frames must only use rsv1 bit if permessage-deflate extension is on

The code I use is pretty much the same as provided in the sample section of PocketSocket. As far as I can see there are no active extensions on the server side. Does anyone have an idea how to either switch on permessage-deflate or to tell the tomcat websocket stack not to use the rsv1 bit?


Solution

  • This Error is caused by a bug in PocketSocket, it fails parsing the Sec-WebSocket-Extension-Header and breaks the permessage-deflate-Handshake. I've fixed it on github and created a pull request for this:

    https://github.com/zwopple/PocketSocket/pull/25