From d9aedfe7d3453e358b28c2feceb3bfa52895d404 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Tue, 12 Mar 2013 13:10:53 -0500 Subject: [PATCH 1/4] Update to version 0.4.0 *** IMPORTANT NOTE *** This is the last minor version to support the Hixie protocol. I may do bug fixes (e.g. 0.4.1) but 0.5.0 will drop the Hixie protocol support. The latest released version of all major browsers (and web-socket-js) support the IETF 6455 protocol. - Other changes: updating TODO and release process notes. --- CHANGES.txt | 6 ++++++ docs/TODO | 9 +++------ docs/notes | 11 +++++++++-- docs/release.txt | 2 -- setup.py | 2 +- 5 files changed, 19 insertions(+), 11 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 1480a3c..b5b8dbd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,12 @@ Changes ======= +0.4.0 - Mar 12, 2013 +-------------------- + + * ***NOTE*** : 0.5.0 will drop Hixie protocol support + * use Buffer base64 support in Node.js implementation + 0.3.0 - Jan 15, 2013 -------------------- diff --git a/docs/TODO b/docs/TODO index cc4b477..7fca9d1 100644 --- a/docs/TODO +++ b/docs/TODO @@ -1,9 +1,6 @@ - Go implementation - -- Support multiple targets that are selected by the path line. Some - sort of wildcarding of ports too. - -- Support SSL targets too. - +- Rust implementation +- Add sub-protocol support to upstream einaros/ws module and use that + instead of the patched module. - wstelnet: support CSI L and CSI M diff --git a/docs/notes b/docs/notes index b3cc0cf..e340375 100644 --- a/docs/notes +++ b/docs/notes @@ -13,5 +13,12 @@ browser. Building web-socket-js emulator: -cd include/web-socket-js/flash-src -mxmlc -static-link-runtime-shared-libraries WebSocketMain.as + cd include/web-socket-js/flash-src + mxmlc -static-link-runtime-shared-libraries WebSocketMain.as + +Building release tarball: + - not really necessary since tagged revision can be downloaded + from github as tarballs + + git archive --format=tar --prefix=websockify-${WVER}/ v${WVER} > websockify-${WVER}.tar + gzip websockify-${WVER}.tar diff --git a/docs/release.txt b/docs/release.txt index 611d4eb..e0e2660 100644 --- a/docs/release.txt +++ b/docs/release.txt @@ -4,8 +4,6 @@ git tag v${WVER} git push origin master git push origin v${WVER} - git archive --format=tar --prefix=websockify-${WVER}/ v${WVER} > websockify-${WVER}.tar - gzip websockify-${WVER}.tar - Register with pypi.python.org (once): python setup.py register - Upload the source distribution to pypi diff --git a/setup.py b/setup.py index ab44ef7..5794bda 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.3.0' +version = '0.4.0' name = 'websockify' long_description = open("README.md").read() + "\n" + \ open("CHANGES.txt").read() + "\n" From db6a7e3e28cd4631d4db8a9ac240a0041d938d60 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Tue, 12 Mar 2013 13:46:45 -0500 Subject: [PATCH 2/4] Update to version 0.4.1 *** IMPORTANT NOTE *** 0.4.X is the last minor version to support the Hixie protocol. 0.5.0 will drop the Hixie protocol support. The latest released version of all major browsers (and web-socket-js) support the IETF 6455 protocol. - Other changes: add 'include/' sub-dir to source distribution and to installed packaged. --- CHANGES.txt | 7 +++++++ MANIFEST.in | 2 +- README.md | 15 ++++++++------- setup.py | 10 +++++++++- 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index b5b8dbd..e2b971c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,13 @@ Changes ======= +0.4.1 - Mar 12, 2013 +-------------------- + + * ***NOTE*** : 0.5.0 will drop Hixie protocol support + * add include/ directory and remove some dev files from source + distribution. + 0.4.0 - Mar 12, 2013 -------------------- diff --git a/MANIFEST.in b/MANIFEST.in index 2dd46d2..27bf0d3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1 +1 @@ -include CHANGES.txt *.py README.md LICENSE.txt +include CHANGES.txt websockify include README.md LICENSE.txt diff --git a/README.md b/README.md index 2cfac0f..1e91910 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,15 @@ the target in both directions. ### WebSockets binary data -Websockify supports all versions of the WebSockets protocol (Hixie and -HyBi). The older Hixie versions of the protocol only support UTF-8 -text payloads. In order to transport binary data over UTF-8 an -encoding must used to encapsulate the data within UTF-8. +Websockify 0.4.X supports all versions of the WebSockets protocol +(Hixie and HyBi). Starting with websockify 0.5.0, only the HyBi / IETF +6455 WebSocket protocol is supported. -With Hixie clients, Websockify uses base64 to encode all traffic to -and from the client. This does not affect the data between websockify -and the server. +The older Hixie versions of the protocol only support UTF-8 text +payloads. In order to transport binary data over UTF-8 an encoding +must used to encapsulate the data within UTF-8. With Hixie clients, +Websockify uses base64 to encode all traffic to and from the client. +This does not affect the data between websockify and the server. With HyBi clients, websockify negotiates whether to base64 encode traffic to and from the client via the subprotocol header diff --git a/setup.py b/setup.py index 5794bda..e53a715 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.4.0' +version = '0.4.1' name = 'websockify' long_description = open("README.md").read() + "\n" + \ open("CHANGES.txt").read() + "\n" @@ -12,6 +12,14 @@ setup(name=name, classifiers=[ "Programming Language :: Python", ], + data_files=[('share/websockify/include', + ['include/util.js', + 'include/base64.js', + 'include/websock.js']), + ('share/websockify/include/web-socket-js', + ['include/web-socket-js/WebSocketMain.swf', + 'include/web-socket-js/swfobject.js', + 'include/web-socket-js/web_socket.js'])], keywords='noVNC websockify', license='LGPLv3', url="https://github.com/kanaka/websockify", From d3865688c8a62ae7b5b675926e05f8ddcb7dff3c Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Tue, 12 Mar 2013 13:54:11 -0500 Subject: [PATCH 3/4] README: no longer supporting Hixie. NOTE: Hixie support is in version 0.4.X. If necessary, I will branch and apply critical fixes release a new 0.4.X tagged version. --- README.md | 26 +++++++++----------------- setup.py | 2 +- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 1e91910..534d85d 100644 --- a/README.md +++ b/README.md @@ -10,25 +10,17 @@ the target in both directions. ### WebSockets binary data -Websockify 0.4.X supports all versions of the WebSockets protocol -(Hixie and HyBi). Starting with websockify 0.5.0, only the HyBi / IETF +Starting with websockify 0.5.0, only the HyBi / IETF 6455 WebSocket protocol is supported. -The older Hixie versions of the protocol only support UTF-8 text -payloads. In order to transport binary data over UTF-8 an encoding -must used to encapsulate the data within UTF-8. With Hixie clients, -Websockify uses base64 to encode all traffic to and from the client. -This does not affect the data between websockify and the server. - -With HyBi clients, websockify negotiates whether to base64 encode -traffic to and from the client via the subprotocol header -(Sec-WebSocket-Protocol). The valid subprotocol values are 'binary' -and 'base64' and if the client sends both then the server (the python -implementation) will prefer 'binary'. The 'binary' subprotocol -indicates that the data will be sent raw using binary WebSocket -frames. Some HyBi clients (such as the Flash fallback and older Chrome -and iOS versions) do not support binary data which is why the -negotiation is necessary. +Websockify negotiates whether to base64 encode traffic to and from the +client via the subprotocol header (Sec-WebSocket-Protocol). The valid +subprotocol values are 'binary' and 'base64' and if the client sends +both then the server (the python implementation) will prefer 'binary'. +The 'binary' subprotocol indicates that the data will be sent raw +using binary WebSocket frames. Some HyBi clients (such as the Flash +fallback and older Chrome and iOS versions) do not support binary data +which is why the negotiation is necessary. ### Encrypted WebSocket connections (wss://) diff --git a/setup.py b/setup.py index e53a715..d52e700 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.4.1' +version = '0.5.0-pre' name = 'websockify' long_description = open("README.md").read() + "\n" + \ open("CHANGES.txt").read() + "\n" From 903198a724aec10e28a2a6e74612452c6650b88a Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Thu, 14 Mar 2013 12:24:58 -0500 Subject: [PATCH 4/4] tests: use new module path and remove Hixie code. --- tests/echo.py | 2 +- tests/load.py | 2 +- tests/utf8-list.py | 8 +++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/echo.py b/tests/echo.py index 878c31a..d79553e 100755 --- a/tests/echo.py +++ b/tests/echo.py @@ -11,7 +11,7 @@ as taken from http://docs.python.org/dev/library/ssl.html#certificates ''' import os, sys, select, optparse -sys.path.insert(0,os.path.dirname(__file__) + "/../") +sys.path.insert(0,os.path.dirname(__file__) + "/../websockify") from websocket import WebSocketServer class WebSocketEcho(WebSocketServer): diff --git a/tests/load.py b/tests/load.py index 0501f7d..0da7265 100755 --- a/tests/load.py +++ b/tests/load.py @@ -7,7 +7,7 @@ given a sequence number. Any errors are reported and counted. ''' import sys, os, select, random, time, optparse -sys.path.insert(0,os.path.dirname(__file__) + "/../") +sys.path.insert(0,os.path.dirname(__file__) + "/../websockify") from websocket import WebSocketServer class WebSocketLoad(WebSocketServer): diff --git a/tests/utf8-list.py b/tests/utf8-list.py index 5a36da0..60a8ae7 100755 --- a/tests/utf8-list.py +++ b/tests/utf8-list.py @@ -6,17 +6,15 @@ Display UTF-8 encoding for 0-255.''' import sys, os, socket, ssl, time, traceback from select import select -sys.path.insert(0,os.path.dirname(__file__) + "/../") +sys.path.insert(0,os.path.dirname(__file__) + "/../websockify") from websocket import WebSocketServer if __name__ == '__main__': - print "val: hixie | hybi_base64 | hybi_binary" + print "val: hybi_base64 | hybi_binary" for c in range(0, 256): - hixie = WebSocketServer.encode_hixie(chr(c)) hybi_base64 = WebSocketServer.encode_hybi(chr(c), opcode=1, base64=True) hybi_binary = WebSocketServer.encode_hybi(chr(c), opcode=2, base64=False) - print "%d: %s | %s | %s" % (c, repr(hixie), repr(hybi_base64), - repr(hybi_binary)) + print "%d: %s | %s" % (c, repr(hybi_base64), repr(hybi_binary))