1. 05 Jan, 2012 1 commit
  2. 15 Dec, 2011 2 commits
  3. 29 Sep, 2011 1 commit
    • Joel Martin's avatar
      websockify --run-once, --timeout, numpy fallback · 1e508715
      Joel Martin authored
      Pull websockify 724aa3a.
      
      - 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.
      
      - New option --run-once will exit after handling a single WebSocket
        connection (but not ater flash policy or normal web requests).
      
      - New option --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.
      1e508715
  4. 10 Sep, 2011 1 commit
  5. 31 Aug, 2011 3 commits
  6. 24 Aug, 2011 1 commit
    • Joel Martin's avatar
      websockify: pull HyBi fixes. · 48f26d79
      Joel Martin authored
      Pull 86af0b614d and 7b496ce5b from websockify.
      
          Fix HyBi support on 64-bit systems.
      
          https://github.com/kanaka/noVNC/issues/76
      
          - cleanup/update TODO.
          - remove explicit check for ctypes module for HyBi.
      
          Clarify that we support HyBi 07-10.
      
          HyBi 07 reports version 7 in the handshake.
          HyBi 08-10 report version 8 in the handshake.
      
          Remove version 9 since that is not yet actually defined.
      48f26d79
  7. 10 Aug, 2011 1 commit
  8. 14 Jul, 2011 1 commit
  9. 09 Jul, 2011 1 commit
    • Joel Martin's avatar
      Pull websockify socket() static method. · 4f8c7465
      Joel Martin authored
      Pull websockify 46e2fbe.
      
      WebSocketServer.socket() is a static method takes a host and port and
      an optional connect parameter. If connect is not set then it returns
      a socket listening on host and port. If connect is set then
      a connection will be made host and port and the socket returned. This
      has IPv6 support like the addrinfo method it replaces.
      
      Also, prefer IPv4 resolutions if they are in the list. This can be
      overriden to prefer IPv6 resolutions for the same host using the
      optional prefer_ipv6 parameter.
      4f8c7465
  10. 07 Jul, 2011 2 commits
  11. 26 Jun, 2011 1 commit
    • Joel Martin's avatar
      Pull fix of recording from websockify. · 8c305c60
      Joel Martin authored
      Pull websockify 7f487fdbd.
      
      The reocrd parameter will turn on recording of all messages sent
      to and from the client. The record parameter is a file prefix. The
      full file-name will be the prefix with an extension '.HANDLER_ID'
      based on the handler ID.
      8c305c60
  12. 19 May, 2011 1 commit
  13. 12 May, 2011 2 commits
  14. 19 Apr, 2011 1 commit
  15. 06 Apr, 2011 2 commits
  16. 05 Apr, 2011 1 commit
    • Joel Martin's avatar
      Refactor keyboard event handling. · c96f9003
      Joel Martin authored
      This is part of addressing issue #21 - non-US keyboard layouts.
      
      There are several challenges when dealing with keyboard events:
        - The meaning and use of keyCode, charCode and which depends on
          both the browser and the event type (keyDown/Up vs keyPress).
        - We cannot automatically determine the keyboard layout
        - The keyDown and keyUp events have a keyCode value that has not
          been translated by modifier keys.
        - The keyPress event has a translated (for layout and modifiers)
          character code but the attribute containing it differs. keyCode
          contains the translated value in WebKit (Chrome/Safari), Opera
          11 and IE9. charCode contains the value in WebKit and Firefox.
          The which attribute contains the value on WebKit, Firefox and
          Opera 11.
        - The keyDown/Up keyCode value indicates (sort of) the physical
          key was pressed but only for standard US layout. On a US
          keyboard, the '-' and '_' characters are on the same key and
          generate a keyCode value of 189. But on an AZERTY keyboard even
          though they are different physical keys they both still
          generate a keyCode of 189!
        - To prevent a key event from propagating to the browser and
          causing unwanted default actions (such as closing a tab,
          opening a menu, shifting focus, etc) we must suppress this
          event in both keyDown and keyPress because not all key strokes
          generate on a keyPress event. Also, in WebKit and IE9
          suppressing the keyDown prevents a keyPress but other browsers
          still generated a keyPress even if keyDown is suppressed.
      
      For safe key events, we wait until the keyPress event before
      reporting a key down event. For unsafe key events, we report a key
      down event when the keyDown event fires and we suppress any further
      actions (including keyPress).
      
      In order to report a key up event that matches what we reported
      for the key down event, we keep a list of keys that are currently
      down. When the keyDown event happens, we add the key event to the
      list. If it is a safe key event, then we update the which attribute
      in the most recent item on the list when we received a keyPress
      event (keyPress should immediately follow keyDown). When we
      received a keyUp event we search for the event on the list with
      a matching keyCode and we report the character code using the value
      in the 'which' attribute that was stored with that key.
      
      For character codes above 255 we use a character code to keysym lookup
      table. This is generated using the util/u2x11 script contributed by
      Colin Dean (xvpsource.org).
      c96f9003
  17. 26 Mar, 2011 1 commit
  18. 03 Feb, 2011 1 commit
    • Joel Martin's avatar
      Add logo, favicon. · 159ad55d
      Joel Martin authored
      Thanks to Michael Sersen for creating images/Logo.svg.
      
      - Add images directory with original SVG logo, favicon, and some
        derivative PNGs of the logo for different purpose.
      
      - Note that license on images/* is CC BY-SA.
      
      - Add utils/img2js.py to take an image and generate a base64 encoded
        data URI string.
      
      - Add base64 encoded data URI screen logo to display in canvas when
        disconnected.
      159ad55d
  19. 01 Feb, 2011 1 commit
  20. 31 Jan, 2011 2 commits
  21. 13 Jan, 2011 2 commits
  22. 12 Jan, 2011 3 commits
    • Joel Martin's avatar
      wstelnet: forgot VT100.js. · c32e00c6
      Joel Martin authored
      c32e00c6
    • Joel Martin's avatar
      Minor correct to wstelnet.js header comment. · 932e7318
      Joel Martin authored
      932e7318
    • Joel Martin's avatar
      wsproxy, wstelnet: wrap command, WS telnet client. · f2538f33
      Joel Martin authored
      wswrapper:
      
          Getting the wswrapper.c LD_PRELOAD model working has turned out to
          involve too many dark corners of the glibc/POSIX file descriptor
          space. I realized that 95% of what I want can be accomplished by
          adding a "wrap command" mode to wsproxy.
      
          The code is still there for now, but consider it experimental at
          best. Minor fix to dup2 and add dup and dup3 logging.
      
      wsproxy Wrap Command:
      
          In wsproxy wrap command mode, a command line is specified instead
          of a target address and port. wsproxy then uses a much simpler
          LD_PRELOAD library, rebind.so, to move intercept any bind() system
          calls made by the program. If the bind() call is for the wsproxy
          listen port number then the real bind() system call is issued for
          an alternate (free high) port on loopback/localhost.  wsproxy then
          forwards from the listen address/port to the moved port.
      
          The --wrap-mode argument takes three options that determine the
          behavior of wsproxy when the wrapped command returns an exit code
          (exit or daemonizing): ignore, exit, respawn.
      
          For example, this runs vncserver on turns port 5901 into
          a WebSockets port (rebind.so must be built first):
      
              ./utils/wsproxy.py --wrap-mode=ignore 5901 -- vncserver :1
      
          The vncserver command backgrounds itself so the wrap mode is set
          to "ignore" so that wsproxy keeps running even after it receives
          an exit code from vncserver.
      
      wstelnet:
      
          To demonstrate the wrap command mode, I added WebSockets telnet
          client.
      
          For example, this runs telnetd (krb5-telnetd) on turns port 2023
          into a WebSockets port (using "respawn" mode since telnetd exits
          after each connection closes):
      
              sudo ./utils/wsproxy.py --wrap-mode=respawn 2023 -- telnetd -debug 2023
      
          Then the utils/wstelnet.html page can be used to connect to the
          telnetd server on port 2023. The telnet client includes VT100.js
          (from http://code.google.com/p/sshconsole) which handles the
          terminal emulation and rendering.
      
      rebind:
      
          The rebind LD_PRELOAD library is used by wsproxy in wrap command
          mode to intercept bind() system calls and move the port to
          a different port on loopback/localhost. The rebind.so library can
          be built by running make in the utils directory.
      
          The rebind library can be used separately from wsproxy by setting
          the REBIND_OLD_PORT and REBIND_NEW_PORT environment variables
          prior to executing a command. For example:
      
              export export REBIND_PORT_OLD="23"
              export export REBIND_PORT_NEW="65023"
              LD_PRELOAD=./rebind.so telnetd -debug 23
      
          Alternately, the rebind script does the same thing:
      
              rebind 23 65023 telnetd -debug 23
      
      Other changes/notes:
      
      - wsproxy no longer daemonizes by default. Remove -f/--foreground
        option and add -D/--deamon option.
      
      - When wsproxy is used to wrap a command in "respawn" mode, the
        command will not be respawn more often than 3 times within 10
        seconds.
      
      - Move getKeysym routine out of Canvas object so that it can be called
        directly.
      f2538f33
  23. 09 Jan, 2011 1 commit
    • Joel Martin's avatar
      wswrapper: add dup2, fix select w/ NULL timeout. · 86725f9b
      Joel Martin authored
      - add dup2 functionality. This requires adding a ref cnt to the
        _WS_connections structure so that we only free the structure once
        all dup'd referenced are closed. Also, refactor malloc and free of
        connection structure into _WS_alloc and _WS_free.
      - allow select to accept a NULL timeout value which means sleep
        forever instead of segfaulting.
      - fix some compile warnings related to ppoll definition.
      - move some WebSockets related html test pages into utils and symlink
        them from tests.
      86725f9b
  24. 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
  25. 07 Jan, 2011 3 commits
    • Joel Martin's avatar
      utils/README.md: horizontal looks better. · 6ace64d3
      Joel Martin authored
      Flip table back to be horizontal. More readable.
      6ace64d3
    • Joel Martin's avatar
      utils/README.md: flip table. Add web server info. · 90966d62
      Joel Martin authored
      Flip the feature table to be tall instead of wide.
      
      Added row about "web server" functionality in wsproxy.py.
      90966d62
    • Joel Martin's avatar
      wsproxy.py: add web serving capability. · 96bc3d30
      Joel Martin authored
      - Added ability to respond to normal web requests. This is basically
        integrating web.py functionality into wsproxy. This is only in the
        python version and it is off by default when calling wsproxy. Turn
        it on with --web DIR where DIR is the web root directory.
      
      Next task is to clean up wsproxy.py. It's gotten unwieldy and it
      really no longer needs to be parallel to the C version.
      96bc3d30
  26. 04 Jan, 2011 1 commit
    • Joel Martin's avatar
      wsproxy: warn when no cert. C sock close cleanup. · 58dc1947
      Joel Martin authored
      Warn early about no SSL cert and add clearer warning when a connection
      comes in as SSL but no cert file exists.
      
      For the C version, cleanup closing of the connection socket. Use
      shutdown for a cleaner cleanup with the client.
      58dc1947
  27. 30 Dec, 2010 1 commit
  28. 29 Dec, 2010 1 commit