Skip to content

Mojo should support both WebSocket specs (old and new) as Chrome/Safari use an old one #185

xaka opened this Issue Jul 24, 2011 · 1 comment

2 participants

xaka commented Jul 24, 2011

Chrome, Safari and web-socket-js send the following data as specified by an old WebSocket specification:

< GET /echo HTTP/1.1
Upgrade: WebSocket
Connection: Upgrade
Sec-WebSocket-Key1: 3 62 9549 3      8B5
Sec-WebSocket-Key2: 845 29 O2;9 7J2


and Mojo response it:

> HTTP/1.1 101 Switching Protocols
Connection: Upgrade
X-Powered-By: Mojolicious (Perl)
Date: Sun, 24 Jul 2011 03:31:42 GMT
Content-Length: 0
Upgrade: websocket
Server: Mojolicious (Perl)

Mojo expects data only in new WebSocket specification format so WebSockets don't work.

I think Mojo should check for received headers and switch between WebSocket handshake implementation depend on (Sec-WebSocket-Key1 && Sec-WebSocket-Key2) or (Sec-WebSocket-Key).

kraih commented Jul 24, 2011

This has been discussed a few times on the mailing list now, feel free to participate in the discussion there.

@kraih kraih closed this Jul 24, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.