diff --git a/CHANGES.txt b/CHANGES.txt index 1480a3c..e2b971c 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,6 +1,19 @@ 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 +-------------------- + + * ***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/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..534d85d 100644 --- a/README.md +++ b/README.md @@ -10,24 +10,17 @@ 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. +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. - -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/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..d52e700 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '0.3.0' +version = '0.5.0-pre' 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", 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))