Reading on websockets the other day I ended in this article about websockets and vnc and it draw my attention immediately over the showmethedesktop project.

Now, given my interest on async servers and my recent interest on their implementation on python along with the rustiness of my perl I decided to try a reimplementation on async python as a way to introduce me to the gevent framework.

First impressions

It is actually feasible to draw a whole screen using just Javascript through canvas and (put/get)ImageData

Some browsers are remarkable faster than others doing this, chrome 15 has a 800×600 draw time of 0-1 msec while Firefox 7 has about 5-13 msec draw time

It is perfectly usable unless you want to play videos or something like that

Project

Available in github, comments and patches are welcome! still in development though.

How did I do it

Very quickly actually, thanks to python and gevent, and specially thanks to other projects I took and adapted code from, such as showmethedesktop, python-vnc-viewer and gevent-websocket.

Most of the html+javascript is just copied from showmethedesktop with some adaptations of my own

I forked gevent-websocket on bitbucket and implemented the new hybi WS protocol on it, it is actually the only thing that current firefox and chrome speak so there was no option there, I also introduced some other small changes

I copied all the rfb(Remote Frame Buffer, VNC protocol) implementation from python-vnc-viewer and then removed the twisted dependency and adapted everything to work on gevent.

Finally thanks to gevent I created the “main” of my app, really just a gevent app

Issues

Gevent and greenlet have some kind of incompatibility on python 2.7, requirements.txt had to include this version http://bitbucket.org/snaury/greenlet/get/tip.zip#egg=greenlet

Howto

git clone git://github.com/arkaitzj/wsvnc.git &&

cd wsvnc &&

virtualenv --no-site-packages sandbox &&

sandbox/bin/pip install -r requirements.txt &&

sandbox/bin/python wsvnc.py



Share this: Twitter

Facebook

Like this: Like Loading... Related