Merge branch 'master' of github.com:astrand/websockify

This commit is contained in:
Peter Åstrand (astrand) 2013-03-18 14:59:03 +01:00
commit 95593ac4bf
10 changed files with 50 additions and 36 deletions

View File

@ -1,6 +1,19 @@
Changes 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 0.3.0 - Jan 15, 2013
-------------------- --------------------

View File

@ -1 +1 @@
include CHANGES.txt *.py README.md LICENSE.txt include CHANGES.txt websockify include README.md LICENSE.txt

View File

@ -10,24 +10,17 @@ the target in both directions.
### WebSockets binary data ### WebSockets binary data
Websockify supports all versions of the WebSockets protocol (Hixie and Starting with websockify 0.5.0, only the HyBi / IETF
HyBi). The older Hixie versions of the protocol only support UTF-8 6455 WebSocket protocol is supported.
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 Websockify negotiates whether to base64 encode traffic to and from the
and from the client. This does not affect the data between websockify client via the subprotocol header (Sec-WebSocket-Protocol). The valid
and the server. subprotocol values are 'binary' and 'base64' and if the client sends
both then the server (the python implementation) will prefer 'binary'.
With HyBi clients, websockify negotiates whether to base64 encode The 'binary' subprotocol indicates that the data will be sent raw
traffic to and from the client via the subprotocol header using binary WebSocket frames. Some HyBi clients (such as the Flash
(Sec-WebSocket-Protocol). The valid subprotocol values are 'binary' fallback and older Chrome and iOS versions) do not support binary data
and 'base64' and if the client sends both then the server (the python which is why the negotiation is necessary.
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://) ### Encrypted WebSocket connections (wss://)

View File

@ -1,9 +1,6 @@
- Go implementation - Go implementation
- Rust implementation
- Support multiple targets that are selected by the path line. Some - Add sub-protocol support to upstream einaros/ws module and use that
sort of wildcarding of ports too. instead of the patched module.
- Support SSL targets too.
- wstelnet: support CSI L and CSI M - wstelnet: support CSI L and CSI M

View File

@ -15,3 +15,10 @@ Building web-socket-js emulator:
cd include/web-socket-js/flash-src cd include/web-socket-js/flash-src
mxmlc -static-link-runtime-shared-libraries WebSocketMain.as 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

View File

@ -4,8 +4,6 @@
git tag v${WVER} git tag v${WVER}
git push origin master git push origin master
git push origin v${WVER} 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): - Register with pypi.python.org (once):
python setup.py register python setup.py register
- Upload the source distribution to pypi - Upload the source distribution to pypi

View File

@ -1,6 +1,6 @@
from setuptools import setup, find_packages from setuptools import setup, find_packages
version = '0.3.0' version = '0.5.0-pre'
name = 'websockify' name = 'websockify'
long_description = open("README.md").read() + "\n" + \ long_description = open("README.md").read() + "\n" + \
open("CHANGES.txt").read() + "\n" open("CHANGES.txt").read() + "\n"
@ -12,6 +12,14 @@ setup(name=name,
classifiers=[ classifiers=[
"Programming Language :: Python", "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', keywords='noVNC websockify',
license='LGPLv3', license='LGPLv3',
url="https://github.com/kanaka/websockify", url="https://github.com/kanaka/websockify",

View File

@ -11,7 +11,7 @@ as taken from http://docs.python.org/dev/library/ssl.html#certificates
''' '''
import os, sys, select, optparse 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 from websocket import WebSocketServer
class WebSocketEcho(WebSocketServer): class WebSocketEcho(WebSocketServer):

View File

@ -7,7 +7,7 @@ given a sequence number. Any errors are reported and counted.
''' '''
import sys, os, select, random, time, optparse 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 from websocket import WebSocketServer
class WebSocketLoad(WebSocketServer): class WebSocketLoad(WebSocketServer):

View File

@ -6,17 +6,15 @@ Display UTF-8 encoding for 0-255.'''
import sys, os, socket, ssl, time, traceback import sys, os, socket, ssl, time, traceback
from select import select 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 from websocket import WebSocketServer
if __name__ == '__main__': if __name__ == '__main__':
print "val: hixie | hybi_base64 | hybi_binary" print "val: hybi_base64 | hybi_binary"
for c in range(0, 256): for c in range(0, 256):
hixie = WebSocketServer.encode_hixie(chr(c))
hybi_base64 = WebSocketServer.encode_hybi(chr(c), opcode=1, hybi_base64 = WebSocketServer.encode_hybi(chr(c), opcode=1,
base64=True) base64=True)
hybi_binary = WebSocketServer.encode_hybi(chr(c), opcode=2, hybi_binary = WebSocketServer.encode_hybi(chr(c), opcode=2,
base64=False) base64=False)
print "%d: %s | %s | %s" % (c, repr(hixie), repr(hybi_base64), print "%d: %s | %s" % (c, repr(hybi_base64), repr(hybi_binary))
repr(hybi_binary))