Websockets returning failed: One or more reserved bits are on: reserved1 = 1, reserved2 = 0, reserved3 = 0

3,504 views
Skip to first unread message

Chris Rankin

unread,
Jan 29, 2014, 1:24:24 PM1/29/14
to thin...@googlegroups.com
When trying to make a websocket connection from the browser I get the following error:

failed: One or more reserved bits are on: reserved1 = 1, reserved2 = 0, reserved3 = 0

I also tried via telnet directly to thin here's the output.

GET /api/v1/sockets/echo HTTP/1.1

Host:crankin.xxx.com

Connection: Upgrade

Upgrade: websocket

Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits, x-webkit-deflate-frame

Sec-WebSocket-Key:jptNAi6PZq4ckiBXNXUm5Q==

Sec-WebSocket-Version:13


HTTP/1.1 101 Switching Protocols

Upgrade: websocket

Connection: Upgrade

Sec-WebSocket-Accept: YKNao2s9zBnMYODP3R4clxzB1xI=


HTTP/1.1 200 OK

Content-Type: text/html

Connection: keep-alive

Server: thin 1.6.1 codename Death Proof


I cannot figure out why a 200 OK is being sent back. I think this is what's causing the problem. 

Any ideas?

Srinivas Gerendla

unread,
Oct 19, 2015, 6:29:32 PM10/19/15
to thin-ruby
Hi Chris,

I am running into similar issue, did you get any resolution. 

Thanks for your time

Chris Rankin

unread,
Oct 20, 2015, 7:09:49 PM10/20/15
to thin...@googlegroups.com, Chris Hall
Oh I honestly don’t remember. I’ve CC’d a co-worker who It think ended up being able to resolve this issue.

Chall, do you remember how we got this working?

Chris

-- 
You received this message because you are subscribed to a topic in the Google Groups "thin-ruby" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/thin-ruby/jZCl47V4hYg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to thin-ruby+...@googlegroups.com.
To post to this group, send email to thin...@googlegroups.com.
Visit this group at http://groups.google.com/group/thin-ruby.
For more options, visit https://groups.google.com/d/optout.

Chris Hall

unread,
Oct 20, 2015, 7:35:20 PM10/20/15
to thin-ruby
If I remember correctly, the issue was the 200 response that follows the 101.  Our problem was that Cramp was incorrectly handling the Websocket upgrade.  Cramp uses Faye-websocket to handle the upgrade, but was then sending that additional 200 response.

The master branch of Cramp has the fix.

Cheers,
~CHall
Reply all
Reply to author
Forward
0 new messages