web-socket-ruby icon indicating copy to clipboard operation
web-socket-ruby copied to clipboard

security digest doesn't match

Open brunofrank opened this issue 12 years ago • 2 comments

When i try to connect to the Socket.io server i get this error.

SocketIO.connect("http://127.0.0.1:8080", sync: true)

send> "GET /socket.io/1/websocket/qyhantvB6h6EAWWccSKr HTTP/1.1\r\n" send> "Upgrade: WebSocket\r\n" send> "Connection: Upgrade\r\n" send> "Host: 127.0.0.1:8080\r\n" send> "Origin: http://127.0.0.1:8080\r\n" send> "Sec-WebSocket-Key1: eD23 1cW62 2 22s16\r\n" send> "Sec-WebSocket-Key2: - 35 35 31X 9 R950 G\r\n" send> "\r\n" send> "\x96\xEDn\xD7Fn{\x81" recv> "HTTP/1.1 101 WebSocket Protocol Handshake\r\n" recv> "Upgrade: WebSocket\r\n" recv> "Connection: Upgrade\r\n" recv> "Sec-WebSocket-Origin: http://127.0.0.1:8080\r\n" recv> "Sec-WebSocket-Location: ws://127.0.0.1:8080/socket.io/1/websocket/qyhantvB6h6EAWWccSKr\r\n" recv> "\r\n" recv> "j\xB9\xBF_\x1E\xE2\xA9\xDC"5U\xE5\xE4\x12A\x17" WebSocket::Error: security digest doesn't match: "j\xB9\xBF_\x1E\xE2\xA9\xDC"5U\xE5\xE4\x12A\x17" != "R\xDF\xBB\b\xDDX\xE0SM\x94B*=\xD6{j" from /home/deploy/www/secret_signals/production/releases/20130531180717/extras/web_socket.rb:122:in initialize' from /home/deploy/www/secret_signals/production/releases/20130531180717/extras/socket_io.rb:61:innew' from /home/deploy/www/secret_signals/production/releases/20130531180717/extras/socket_io.rb:61:in connect_transport' from /home/deploy/www/secret_signals/production/releases/20130531180717/extras/socket_io.rb:51:instart' from /home/deploy/www/secret_signals/production/releases/20130531180717/extras/socket_io.rb:18:in `connect'

I realy don't know waht is going on, because in my development machine works well, but in production server it crashes.

Thanks!

brunofrank avatar May 31 '13 21:05 brunofrank

Hm I'm not sure why at a glance. Anyway web-socket-ruby speaks old draft version of WebSocket protocol, not one in RFC. I should update the library to speak the new protocol. I'm not sure whether it is the reason of the error, though. If you want to use the new version of the protocol now, you can use em-httprequest instead, which I guess speaks the new protocol: http://rubydoc.info/gems/em-http-request/0.3.0/file/README.md#WebSocket_example

gimite avatar Jun 09 '13 13:06 gimite

I'm having the security digest issue as well. Unfortunately em-http-request dropped WebSocket support after version 1.0.0. Just a heads up!

meltingice avatar Jul 02 '13 21:07 meltingice