From 6bd04c85f6028c91d8c2e72b9c1a0a8481bf6aef Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 12 Sep 2011 19:58:54 -0400 Subject: [PATCH 1/6] wulczer told me to do this for firefox 6 --- websocket.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/websocket.py b/websocket.py index ab2dcc9..5c4e880 100644 --- a/websocket.py +++ b/websocket.py @@ -258,7 +258,7 @@ def _clientHandshakeHybi(self): """ version = self._getOneHeader("Sec-WebSocket-Version") # we only speak version 8 of the protocol - if version != "8": + if version not in ("7", "8"): self.setResponseCode(426, "Upgrade Required") self.setHeader("Sec-WebSocket-Version", "8") return self.finish() From c9d8215fc3ab0bf912ba4c335882d3eb9e972b06 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 12 Sep 2011 20:01:09 -0400 Subject: [PATCH 2/6] make this an importable module --- __init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 __init__.py diff --git a/__init__.py b/__init__.py new file mode 100644 index 0000000..e69de29 From 56983df084549e637030371fc37934b6fc34690a Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 12 Sep 2011 20:01:34 -0400 Subject: [PATCH 3/6] ignore .pyc --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc From 6485bc09c4c3141e9d721462a8b2b05bf4dfc9cb Mon Sep 17 00:00:00 2001 From: Chad Selph Date: Wed, 19 Oct 2011 14:53:33 -0700 Subject: [PATCH 4/6] Also allow version 13 in hybi client handshake The protocol changes don't really affect the rest of the code we never check Sec-WebSocket-Version in the hybi-8 flow. --- websocket.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/websocket.py b/websocket.py index 5c4e880..baae88b 100644 --- a/websocket.py +++ b/websocket.py @@ -247,9 +247,9 @@ def _getOneHeader(self, name): def _clientHandshakeHybi(self): """ - Initial handshake, as defined in hybi-10. + Initial handshake, as defined in hybi-10 and 16 (versions 8 and 13). - If the client is not following the hybi-10 protocol or is requesting a + If the client is not following the hybi-10 or 16 protocol or is requesting a version that's lower than what hybi-10 describes, the connection will be closed. @@ -257,8 +257,8 @@ def _clientHandshakeHybi(self): plugged in and the connection will be estabilished. """ version = self._getOneHeader("Sec-WebSocket-Version") - # we only speak version 8 of the protocol - if version not in ("7", "8"): + # we only speak version 7, 8 and 13 of the protocol + if version not in ("7", "8", "13"): self.setResponseCode(426, "Upgrade Required") self.setHeader("Sec-WebSocket-Version", "8") return self.finish() From 8cd06f41805bf662e4266e8f12771c3af553906e Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 17 Mar 2012 17:24:32 +0100 Subject: [PATCH 5/6] make it work with mozilla too without flash --- index.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index a685599..bae2948 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,12 @@