It's probably broken and it's definitely still messy in several ways,
but basic tests work with Chrome.
Several other C websockify cleanups:
- Remove most of the non-thread safe global variable usage (still
a little bit that could be fixed so that threading would be easier).
- Remove wswrapper. It is unmaintained, out of date, and never worked
well anyways (since it really needed a way to do asynchronous queued
work but it was running in another process context making that
hard).
- Use md5 routines from openssl.
- Remove md5.c and md5.h since no longer needed.
Thanks to https://github.com/dew111 for spurring me on to get this
done by writing code. I didn't end up using much his forked code, but
having something there goaded me enough to just get it working.
If no length parameter is given to rQshiftStr or rQshiftBytes, then
the all remaining data (the full length) will be shifted off.
Also, honor the window.WEB_SOCKET_FORCE_FLASH variable to force
web-socket-js to be used even if the browser has native WebSockets
support.
Try importing from the newest location/name and then fallback if that
fails instead of using python version switches.
Still use version switch for the buffer/bytes to string wrapper
routines since python 2.6 has intermediate support for buffer/bytes
and I want to know if full support (ala python 3.0) is there.
- Use array module for unmasking HyBi when no numpy module is
available.
- Detect client close properly when using python 3.
- Print request URL path is specified.
- --run-once will exit after handling a single WebSocket connection
(but not ater flash policy or normal web requests).
- --timeout TIME will stop listening for new connections after exit
after TIME seconds (the master process shuts down). Existing
WebSocket connections will continue but once all connections are
closed all processes will terminate.
Use rsplit(':', 1) instead of rpartition(':') in port argument
processing.
python2.4 may or may not work with HyBi which requires the numpy and
ctypes modules.