Skip to content

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

Closed
xaka opened this Issue Jul 24, 2011 · 1 comment

2 participants

@xaka
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
Host: 10.3.199.16:3000
Origin: http://10.3.199.16:3000
Sec-WebSocket-Key1: 3 62 9549 3      8B5
Sec-WebSocket-Key2: 845 29 O2;9 7J2

��VU#Բ

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)
Sec-WebSocket-Accept:


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
Owner
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.

http://groups.google.com/group/mojolicious/browse_thread/thread/b6134999ce7df7d0

@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.