• Joel Martin's avatar
    Refactor and cleanup websocket.py and deps. · 6a883409
    Joel Martin authored
    Moved websocket.py code into a class WebSocketServer. WebSockets
    server implementations will sub-class and define a handler() method
    which is passed the client socket after. Global variable settings have been
    changed to be parameters for WebSocketServer when created.
    
    Subclass implementations still have to handle queueing and sending but
    the parent class handles everything else (daemonizing, websocket
    handshake, encode/decode, etc). It would be better if the parent class
    could handle queueing and sending. This adds some buffering and
    polling complexity to the parent class but it would be better to do so
    at some point. However, the result is still much cleaner as can be
    seen in wsecho.py.
    
    Refactored wsproxy.py and wstest.py (formerly ws.py) to use the new
    class. Added wsecho.py as a simple echo server.
    
    - rename tests/ws.py to utils/wstest.py and add a symlink from
      tests/wstest.py
    
    - rename tests/ws.html to tests/wstest.html to match utils/wstest.py.
    
    - add utils/wsecho.py
    
    - add tests/wsecho.html which communicates with wsecho.py and simply
      sends periodic messages and shows what is received.
    6a883409
Name
Last commit
Last update
..
base64.html Loading commit data...
base64.js Loading commit data...
canvas.html Loading commit data...
cursor.html Loading commit data...
face.png Loading commit data...
face.png.js Loading commit data...
include Loading commit data...
input.html Loading commit data...
keyboard.html Loading commit data...
vnc_perf.html Loading commit data...
vnc_playback.html Loading commit data...
wsecho.html Loading commit data...
wsencoding.html Loading commit data...
wsencoding.py Loading commit data...
wstest.html Loading commit data...
wstest.py Loading commit data...