1. 08 Jan, 2011 1 commit
    • 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
  2. 07 Jan, 2011 5 commits
  3. 04 Jan, 2011 4 commits
  4. 03 Jan, 2011 1 commit
  5. 30 Dec, 2010 1 commit
  6. 29 Dec, 2010 1 commit
  7. 28 Dec, 2010 1 commit
  8. 27 Dec, 2010 2 commits
    • Joel Martin's avatar
      wswrapper: timeout select. · 64dbc6bb
      Joel Martin authored
      The select call needs to timeout if a WebSocket socket keeps reporting
      ready but actually isn't ready. To prevent it hanging forever in that
      condition, the timeout value is now adjusted now for each call.
      
      Move the DO_DEBUG and DO_TRACE settings to wswrapper.c.
      64dbc6bb
    • Joel Martin's avatar
      wswrapper: interpose select/pselect. Cleaup. · 6b900d25
      Joel Martin authored
      Interpose on select/pselect so that WebSockets sockets are only
      reported as ready if they have enough to actually decode at least
      1 byte of real data. This prevents hanging in read/recv after
      WebSocket is reported as ready but is not actually ready because empty
      frames or less than four base64 bytes have been received.
      
      Split defines and constant defintions into wswrapper.h.
      
      Cleanup debug output and add TRACE for more detailed tracing debug
      output.
      
      Major TODO is that select needs to timeout if WebSocket socket keeps
      reporting ready but actually isn't ready. That condition will
      currently hang forever because the select timeout value is not
      adjusted when looping.
      6b900d25
  9. 25 Dec, 2010 1 commit
  10. 24 Dec, 2010 1 commit
  11. 21 Dec, 2010 3 commits
  12. 16 Dec, 2010 1 commit
    • Joel Martin's avatar
      wswrapper: fix preload path and interpose port. · 40a653f5
      Joel Martin authored
      Make path to ld preload library absolute so wswrapper works even if
      path is changed before main program is executed (i.e. by the vncserver
      wrapper script).
      
      bind() was using the return value for the port number, but it's
      actually the original port number that we should interpose on in the
      bind() routine.
      40a653f5
  13. 14 Dec, 2010 2 commits
  14. 13 Dec, 2010 1 commit
    • Joel Martin's avatar
      wswrap: WSWRAP_PORT envvar and wswrap script. · 70c58596
      Joel Martin authored
      wswrapper.so will only interpose on the listen port specified in
      WSWRAP_PORT.
      
      Add simple wswrap script that sets the WSWRAP_PORT, LD_PRELOAD and
      invokes the command line to wrap.
      70c58596
  15. 10 Dec, 2010 1 commit
    • Joel Martin's avatar
      Make compatible with jQuery. Slight API change. · e4671910
      Joel Martin authored
      Rename the $() selector to $D() so that it doesn't collide with
      the jQuery name.
      
      The API change is that the 'target' option for Canvas and RFB objects
      must now be a DOM Canvas element. A string is no longer accepted
      because this requires that a DOM lookup is done and the Canvas and RFB
      should have no UI code in them. Modularity.
      e4671910
  16. 03 Dec, 2010 1 commit
    • Joel Martin's avatar
      wswrapper: wrap existing server using LD_PRELOAD. · 5b0bbd5c
      Joel Martin authored
      wswrapper.so is LD_PRELOAD shared library that interposes and turns
      a generic TCP socket into a WebSockets service.
      
      This current version works but will only allow work for a single
      connection, subsequent connections will not be wrapped. In addition
      the wrapper interposes on the first incoming network connection. It
      should read an environment variable to determine the port to interpose
      on. Also, should limit origin based on another environment variable.
      Then there should be a wswrap setup script that allows easier
      invocation.
      5b0bbd5c
  17. 15 Nov, 2010 1 commit
    • Joel Martin's avatar
      rfb.js: avoid multiple b64 sequences per frame. · 79f0a095
      Joel Martin authored
      Only call encode_message when the WebSockets object is actually
      ready to send. Otherwise multiple base64 encode sequences can be
      encoded into the same WebSockets frame. This causes the C version of
      wsproxy to crash and the python version to ignore the subsequent
      base64 sequence(s).
      
      Thanks to Colin Dean (xvpsource.org) for finding this and helping
      track it down.
      79f0a095
  18. 10 Nov, 2010 1 commit
  19. 09 Nov, 2010 1 commit
    • Joel Martin's avatar
      Add Chrome Frame support. Close requests in web.py. · e66f3f89
      Joel Martin authored
      - Add meta tag to vnc.html and vnc_auto.html so that if Chrome Frame
        is installed, it is used.
      
      - Add detection to default_controls.js that shows a message with
        a Chrome Frame install link if the user is using a version of IE
        without Canvas support.
      
      - Fix web.py so that requests have their connection closed after they
        are completed.  This has been a bug for a while but it prevents
        Chrome Frame from working because Chrome Frame doesn't activate
        until the initial request connection closes.
      e66f3f89
  20. 08 Nov, 2010 2 commits
  21. 06 Nov, 2010 7 commits
  22. 28 Oct, 2010 1 commit