- web-socket-js is from http://github.com/gimite/web-socket-js. It is a flash object that emultates WebSockets. Unfortunately, events (or packets) from the web-socket-js object can get re-ordered so we need to know the packet order. - So wsproxy.py prepends the sequence number of the packet when sending. - If the client receives packets out of order it queues them up and scans the queue for the sequence number it's looking for until things are back on track. Gross, but hey: It works! - Also, add packet sequence checking to wstest.* |
||
---|---|---|
docs | ||
include | ||
README.md | ||
TODO | ||
canvas.html | ||
canvas.js | ||
prime.html | ||
prime.js | ||
rfb_notes | ||
vnc.html | ||
vnc.js | ||
web.py | ||
wsproxy.py | ||
wstest.html | ||
wstest.py |
README.md
VNC HTML5 Client
Description
An VNC client implemented using HTML5, specifically Canvas and Web Sockets.
Requirements
-
A browser that supports Web Sockets (mostly Chrome as of Apr 6, 2010) and Canvas (most browsers)
-
Until VNC server support web sockets, you need to use a Web Sockets to normal socket proxy. There are a couple reasons for this:
-
Web Sockets is not a pure socket protocol. There is an initial HTTP like handshake to allow easy hand-off by web servers and allow some origin policy exchange. Also, each Web Sockets frame begins with 0 ('\x00') and ends with 255 ('\xff').
-
Javascript itself does not have the ability to handle pure byte strings (Unicode encoding messes with it) even though you can read them with Web Sockets. The python proxy base64 encodes the data so that the Javascript client can base64 decode the data into an array.
-
Usage
-
run a VNC server.
Xvnc :1
-
run the python proxy:
./wsproxy.py [listen_port] [vnc_host] [vnc_port]
./wsproxy.py 8787 localhost 5901
-
run the mini python web server to serve the directory:
./web.py PORT
./web.py 8080
-
Point your web browser at http://localhost:8080/vnc.html (or whatever port you used above to run the web server).
-
Provide the host and port where the proxy is running and the password that the vnc server is using (if any).