Commit Graph

54 Commits

Author SHA1 Message Date
Joel Martin 6d1e216115 fork noVNC, rename to websockify, cleanup.
Split of wsproxy from noVNC and rename it websockify.
2011-01-12 18:09:54 -06:00
Joel Martin f2538f337d wsproxy, wstelnet: wrap command, WS telnet client.
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.
2011-01-12 13:15:11 -06:00
Joel Martin 96bc3d3088 wsproxy.py: add web serving capability.
- 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.
2011-01-06 18:26:54 -06:00
Joel Martin 58da507bb8 README: add companies/projects using noVNC. 2011-01-04 12:19:54 -06:00
Joel Martin f7ec5b2cb6 Rename default_controls.js to ui.js.
And DefaultControls to UI.
2010-11-10 16:02:19 -06:00
Joel Martin e5d60a8ba2 Issue #32, wsproxy README, update webkit bug info,
- Add wsproxy README.md in utils/ directory.

- Document how to build ssl module for python 2.5 and older in wsproxy
  README.

- Update browsers.md to note revision that have the webkit Canvas
  rendering bug: WebKit build 66396 through 68867 (Chrome/Chromium
  build 57968 through 61278).
2010-10-28 10:45:26 -05:00
Joel Martin d4139a9b06 README.md: move browser page link. 2010-09-24 10:45:33 -05:00
Joel Martin 6de07adb71 README.md: add link to browsers.md, update requirements. 2010-09-24 10:29:42 -05:00
Joel Martin 5f409eeeeb License header cleanup. 2010-09-08 15:06:34 -05:00
Joel Martin 8db09746b7 New API. Refactor Canvas and RFB objects.
New API:

To use the RFB object, you now must instantiate it (this allows more
than one instance of it on the same page).

    rfb = new RFB(settings);

The 'settings' variable is a namespace that contains initial default
settings. These can also be set and read using 'rfb.set_FOO()' and
'rfb.get_FOO()' where FOO is the setting name. The current settings
are (and defaults) are:
    - target: the DOM Canvas element to use ('VNC_canvas').
    - encrypt: whether to encrypt the connection (false)
    - true_color: true_color or palette (true)
    - b64encode: base64 encode the WebSockets data (true)
    - local_cursor: use local cursor rendering (true if supported)
    - connectTimeout: milliseconds to wait for connect (2000)
    - updateState: callback when RFB state changes (none)
    - clipboardReceive: callback when clipboard data received (none)

The parameters to the updateState callback have also changed. The
function spec is now updateState(rfb, state, oldstate, msg):
    - rfb: the RFB object that this state change is for.
    - state: the new state
    - oldstate: the previous state
    - msg: a message associate with the state (not always set).

The clipboardReceive spec is clipboardReceive(rfb, text):
    - rfb: the RFB object that this text is from.
    - text: the clipboard text received.

Changes:

- The RFB and Canvas namespaces are now more proper objects. Private
  implementation is no longer exposed and the public API has been made
  explicit. Also, instantiation allows more than one VNC connection
  on the same page (to complete this, DefaultControls will also need
  this same refactoring).

- Added 'none' logging level.

- Removed automatic stylesheet selection workaround in util.js and
  move it to defaultcontrols so that it doesn't interfere with
  intergration.

- Also, some major JSLinting.

- Fix input, canvas, and cursor tests to work with new model.
2010-08-02 17:07:27 -05:00
Joel Martin 0af07711ec README.md: fix command formatting. 2010-07-26 17:41:19 -05:00
Joel Martin acad10a5de README.md: correction about VNC_uri_prefix.
It points to the include sub-directory, not to the directory above.
2010-07-23 12:32:15 -05:00
Joel Martin b4748f041a Add twitter link to follow @noVNC for commits/news. 2010-07-23 12:30:31 -05:00
Joel Martin 11304584ca README.md: Add more bug/issue suggested info. 2010-07-23 09:25:16 -05:00
Joel Martin 2c2b492c0c Add Cursor pseudo-encoding support (disabled for now).
To change the appearance of the cursor, we use the CSS cursor style
and set the url to a data URI scheme. The image data sent via the
cursor pseudo-encoding has to be encoded to a CUR format file before
being used in the data URI.

During Canvas initialization we try and set a simple cursor to see if
the browser has support. Opera is missing support for data URI scheme
in cursor URLs.

Disabled for now until we have a better way of specifying settings
overall (too many settings for control bar now).
2010-07-20 14:34:44 -05:00
Joel Martin 3b6f60be7d Typos and formatting. 2010-07-15 20:22:55 -05:00
Joel Martin b89c6db3a1 Launch script and reworked usage in README.md. 2010-07-15 20:18:39 -05:00
Joel Martin 53b112f2a6 Add info on firefox 3.0.17. 2010-07-15 19:22:07 -05:00
Joel Martin 77c7a454ac TightPng fixups and thanks to Sentry Data Systems.
- Change tightpng encoding number to -260 (aliguori provided it until
  an official number can be allocated).
2010-07-13 17:51:26 -05:00
Joel Martin 852ba642be Screenshots section, link to more. 2010-07-09 11:41:36 -05:00
Joel Martin 600887f053 README.md: caption formatting. 2010-07-09 10:52:42 -05:00
Joel Martin e5517ecd25 README.md: image caption and bigger dimensions. 2010-07-09 10:51:51 -05:00
Joel Martin 6b41d1d5a5 Add screenshots to README.md. 2010-07-09 10:50:33 -05:00
Joel Martin 0a32dfd31a Markdown links in README.md. 2010-07-07 16:06:44 -05:00
Joel Martin a095b38262 Add troubleshooting section. 2010-07-06 12:29:37 -05:00
Joel Martin b8e07362d9 A little more cleanup of browser table. 2010-07-02 12:50:34 -05:00
Joel Martin 3df41d67e1 More browser table cleanup. 2010-07-02 12:40:29 -05:00
Joel Martin 47ef64634f Remove unsupported table colors. Cleanup table. 2010-07-02 12:34:37 -05:00
Joel Martin c54a65ba09 README.md: try browser tests in table. 2010-07-02 12:25:13 -05:00
Joel Martin f5769b00ea Test table in markdown. 2010-07-02 12:12:30 -05:00
Joel Martin 5ba1dd78ba README/TODO: Windows browser testing results. 2010-07-02 12:02:57 -05:00
Joel Martin e091b47a9f Clarify browser results in README.md 2010-07-01 12:18:18 -05:00
Joel Martin 2b71a4db58 Update web-socket-js binary build and README.md
Brings it up to date with the most recent web-socket-js event handling
fixes.
2010-07-01 12:04:26 -05:00
Joel Martin a93c955538 Opera works! Fix message event drops/reorders.
Instead of relying on FABridge AS -> JS event delivery, we just use
the events to notify JS of pending data. The message handler then
calls the AS readSocketData routine which sends back an array of
the pending WebSocket frames.

There is still a minor bug somewhere that happens after the first
connect where the web-socket-js throws an "INVALID_STATE_ERR: Web
Socket connection has not been established". But, Opera is now usable
and we should be able to drop the packet sequence numbering and
re-ordering code.

Another minor issue to better support Opera is to move JS script
includes to the <head> of the page instead of after the body.
2010-07-01 09:53:38 -05:00
Joel Martin d93d3e09ab Various cross-browser fixes.
Now working under Arora 0.5.

But not Konqueror 4.2.2 (WebSockets never connects).

IE support with excanvas still pending.
2010-06-23 16:08:36 -05:00
Joel Martin 3915e5365e Update README.md with browser support. 2010-06-21 13:20:57 -05:00
Joel Martin 146071161f Update usage and README.md. 2010-06-17 17:50:15 -05:00
Joel Martin f2898eabd3 Add listen address to proxy (C and python).
This allows forwarding from an external port to the same port on
localhost (loopback). I.e.

./utils/wsproxy `hostname -f`:5901 localhost:5901
2010-06-16 12:37:03 -05:00
Joel Martin 96a6eaadbc Move vnc.js into include directory.
Also, allow 'include/' to be overridden in VNC_uri_prefix.
2010-06-14 14:56:19 -05:00
Joel Martin a4807656a2 Move cert gen to Usage section of README.md. 2010-06-14 14:34:05 -05:00
Joel Martin 7210e79e04 Move wsproxy and web utils into utils/ subdir. 2010-06-07 12:49:57 -05:00
Joel Martin 4f0da9ef84 Clarify examples. 2010-06-03 08:39:42 -05:00
Joel Martin 1aa9506251 Explain VNC_uri_prefix in README.md. 2010-06-02 17:28:28 -05:00
Joel Martin d0e01e064c Update README.md to reflect separate default controls file. 2010-06-02 17:18:46 -05:00
Joel Martin 8fe2c2f915 Fix web-socket-js loading issue. 2010-05-17 17:11:13 -05:00
Joel Martin 753bde8f53 Cleanup output, trap exceptions, timing output, fixes.
Fixes:
- Make sure that failed state messages stay around until next connect.
- Get status message font colors working.
- Clear RQ_reorder list on re-connect.
2010-05-15 12:38:50 -05:00
Joel Martin 71d2426a8e Rename HTML5-VNC to noVNC. 2010-05-12 09:39:38 -05:00
Joel Martin dcd950a044 Mark include/plain.css as code. 2010-05-11 15:04:07 -07:00
Joel Martin ded9dfae10 Styling/integration refactoring.
- Instead of onload override, move to RFB.load function that takes
  a parameter for the target DOM ID. This allows the user to have
  their own onload function.

- Add "VNC_" prefix to all element ID names. Only create DOM elements
  if they don't already exist on the page, otherwise use the existing
  elements.

- Move all styling to separate stylesheet.

- Use list model for control styling.
2010-05-11 16:13:52 -05:00
Joel Martin adfe6ac166 Support for SSL/TLS ('wss://') on both sides.
On the client side, this adds the as3crypto library to web-socket-js
so that the WebSocket 'wss://' scheme is supported which is WebSocket
over SSL/TLS.

Couple of downsides to the fall-back method:

    - This balloons the size of the web-socket-js object from about 12K to 172K.

    - Getting it working required disabling RFC2718 web proxy support
      in web-socket-js.

    - It makes the web-socket-js fallback even slower with the
      encryption overhead.

The server side (wsproxy.py) uses python SSL support. The proxy
automatically detects the type of incoming connection whether flash
policy request, SSL/TLS handshake ('wss://') or plain socket
('ws://').

Also added a check-box to the web page to enable/disabled 'wss://'
encryption.
2010-04-30 16:41:09 -05:00