Commit Graph

334 Commits

Author SHA1 Message Date
Joel Martin e3716842ef include/rfb.js: show Flash version in console. 2011-01-04 10:27:25 -06:00
Joel Martin bf5ee68828 Expose getKeysym and add keyboard test.
Related to issue Non-US keyboard layout option issue:
https://github.com/kanaka/noVNC/issues#issue/21
2011-01-03 12:34:41 -06:00
Joel Martin 56d9aa816b wswrapper: interpose on poll/ppoll also.
poll/ppoll interposer builds but is untested.
2010-12-27 19:44:14 -07:00
Joel Martin 64dbc6bb63 wswrapper: timeout select.
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.
2010-12-27 16:08:27 -07:00
Joel Martin 6b900d25d0 wswrapper: interpose select/pselect. Cleaup.
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.
2010-12-27 13:21:07 -07:00
Joel Martin fce6ac5cb4 Fix to "Tolerate fragmented ServerInit".
Issue #39: https://github.com/kanaka/noVNC/issues/issue/39
2010-12-24 17:39:13 -07:00
Joel Martin 318d473438 Tolerate fragmented ServerInit.
Issue #39: https://github.com/kanaka/noVNC/issues/issue/39
2010-12-24 15:02:48 -07:00
Joel Martin 0f7f146f20 utils/launch.sh: find top web dir (with vnc.html). 2010-12-21 10:17:43 -06:00
Amir Malik b992f7c7dd use cd, dirname, and pwd to determine path instead of readlink (Mac fix) 2010-12-22 00:15:33 +08:00
Amir Malik a22a3cc0ea set socket option SO_REUSEADDR to prevent "Address already in use" error 2010-12-21 23:31:46 +08:00
Joel Martin 40a653f555 wswrapper: fix preload path and interpose port.
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.
2010-12-16 14:04:16 -06:00
Joel Martin b144a0933d wswrapper: Normalize comments, remove unused headers. 2010-12-14 13:14:21 -05:00
Joel Martin c99124b527 wswrapper: Allow multiple WebSockets connections.
Allocate buffer and state memory for each accepted connection. This
allows all WebSockets connections to a given listen port to be wrapped
with WebSockets support.
2010-12-14 13:14:12 -05:00
Joel Martin 70c585968b wswrap: WSWRAP_PORT envvar and wswrap script.
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.
2010-12-13 14:20:34 -05:00
Joel Martin e46719100c Make compatible with jQuery. Slight API change.
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.
2010-12-10 08:25:36 -06:00
Joel Martin 5b0bbd5c12 wswrapper: wrap existing server using LD_PRELOAD.
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.
2010-12-02 22:11:02 -06:00
Joel Martin 79f0a095b6 rfb.js: avoid multiple b64 sequences per frame.
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.
2010-11-15 13:43:26 -05: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 e66f3f89f2 Add Chrome Frame support. Close requests in web.py.
- 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.
2010-11-09 12:06:03 -06:00
Joel Martin 1ee2d93e94 wsproxy.js: Fix multi-frame decoding.
- Also, discovered node.js bug in base64 decoding. Added test case and
  filed https://github.com/ry/node/issues/issue/402
2010-11-07 22:28:08 -06:00
Joel Martin fd758dd335 First pass at wsproxy using node (node.js).
Node:
    http://nodejs.org/
    https://github.com/ry/node

It mostly works, but it eventually gets an error from the target which
is probably due to missing support for re-assembly of client
WebSockets frames.
2010-11-07 19:06:20 -06:00
Joel Martin 58b4c9408f wsproxy: Fix --key parameter use. 2010-11-06 14:12:37 -05:00
Joel Martin c1d008f1ee Fix flush with strict DOCTYPE.
- With a strict doctype, the margin size needs a "px" suffix.
2010-11-06 14:11:30 -05:00
Joel Martin cdb55d26e5 canvas.js: workaround WebKit bug, issue #28.
This is WebKit bug https://bugs.webkit.org/show_bug.cgi?id=46319

The workaround is to wrap Canvas render functions with a function that
sets a flush timer. The flush function sets the right margin and then
1ms later sets it back. This triggers the canvas to redraw with the
correct contents.

Two downsides:
- rendering is slower, but only on the busted versions of webkit.
  Correct and useful is better than fast and useless.
- There is a barely perceptible jitter of the control buttons because
  the canvas size is changing by one pixel.

To support this functionality, we also have to read out the exact
webkit version from the user agent in the render engine detection code
in include/util.js.
2010-11-06 12:23:23 -05:00
Joel Martin 455e4657f6 default_controls.js: canvas fail fix. Misc cleanup.
- Make sure that canvas exists (i.e. didn't throw an error) before
  trying to call canvas method get_canvas_uri.

- Typos in HTML render engine debug output.
2010-11-06 12:15:08 -05:00
Joel Martin 3205a3dee8 Add --key option for separate cert and key file.
If only --cert is specified then continue to assume both certificate
and key are in the same file (key first).
2010-11-06 10:55:09 -05:00
Joel Martin e70f1d947e Remove left over record code. Squelch compile warnings 2010-11-06 10:53:32 -05:00
François Revol f61274c827 wsproxy: Mac OS X build fixes
- pass CFLAGS and LDFLAGS in case one needs to use -m32
- link to libcrypto for _ERR_print_errors_fp
- __THROW is non-standard define it to nothing by default
- use b64_ntop and b64_pton instead of mangled versions, OSX doesn't mangle them in the same way
- access() takes two arguments!

Signed-off-by: François Revol <revol@free.fr>
2010-11-06 10:04:24 -05:00
Joel Martin 1f758e87d3 Issue #34: fix RFB 3.3/3.7 with no auth scheme.
- Split out ClientInitialisation state.

- In version 3.3 and 3.7, when the server has no auth (scheme
  1), then we should skip from Authentication to ClientInitialisation.
2010-10-28 16:30:41 -05:00
Joel Martin 3dc3135b21 utils/README.md: second try on cmd formatting. 2010-10-28 10:53:08 -05:00
Joel Martin 6502293f21 utils/README.md: Fix command formatting. 2010-10-28 10:52:27 -05: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 f1a9971c82 Expose VNC shared mode setting in UIs.
If shared mode is false, then the server should disconnect other
connections before the current connection is allowed to proceed.
2010-10-24 18:34:50 -05:00
Joel Martin 65bca0c904 Fix style caching. Canvas cleanup from Diet-noVNC.
- Style caching gives a small performance speedup in firefox, but not
  much. Might not be worth complexity, but leave it in for now.
2010-10-18 14:30:50 -05:00
Joel Martin 028b26f14b Fix reason_len not defined bug. 2010-10-14 11:07:54 -05:00
Joel Martin ce2b6909cd rfb.js: fail() wrapper for common failed pattern. 2010-10-14 10:09:33 -05:00
Joel Martin 8b17ac27f0 Add manual flash policy socat server info. 2010-10-10 18:59:02 -05:00
Joel Martin c084c396ba utils/Makefile: clean up md5.o too. 2010-10-04 13:30:53 -04:00
Joel Martin 60440cee15 rfb.js: rQwait, cuttext simplification.
- rQwait checks the receive queue to see if there is enough data to
  satisfy the following request. If not it returns true (which is
  almost always translated into an immediate return false by the
  caller).

- rQwait is called quite a bit and this generally allows 4 lines to
  become 1 line where it is called.

- rQwait allows simplification of cuttext processing. No global
  tracking needed anymore.

Overall, about 60 lines less code.
2010-10-01 11:50:22 -05:00
Joel Martin a99959719d include/des.js: trim some fat.
DES is just used once during authentication and is not performance
sensitive so we save some space by generating and/or removing some
lookup tables. Also, shorten some very frequently used variables.

Shaves off about 100 lines.
2010-09-30 11:17:52 -05:00
Joel Martin a59f1cd269 webutil.js, util.js: split cleanup. 2010-09-29 15:05:27 -05:00
Joel Martin 5a00c9d18a Merge branch 'master' of git@github.com:kanaka/noVNC 2010-09-29 15:01:01 -05:00
Antoine Mercadal 8d5d2c8230 Split util into two file:
- util.js that contains essential functions
 - webutils.js that contains the GUI utility function.js

this helps to include noVNC in other project, especially Cappuccino Application
i
2010-09-30 03:59:56 +08:00
Joel Martin 12d2e7c192 des.js: remove decrypt and simplify.
The decrypt functionality is never used so remove it. Also, we can
assume that we are always DES encrypting 16 characters which allows
several things to be simplified in DES.

Overall this removes about 80 lines of code.
2010-09-29 14:48:19 -05:00
Joel Martin a679a97d1b Show rect/enc counts, add vnc_perf.html test.
- include/rfb.js: Keep track of the number of rects of each encoding
  type and print them out when we close a connection (if 'info'
  logging level).

- tests/vnc_perf.html: first pass at a noVNC based performance
  benchmark.

- utils/wsproxy.py: Fix the output of the record filename.
2010-09-25 15:50:43 -05:00
Joel Martin 3b20e7a90f rfb.js, canvas.js: status feedback on Canvas functionality.
Read the render mode selected by canvas and report it in the initial
page loaded status message.
2010-09-24 10:47:39 -05:00
Joel Martin 562beccf18 docs/browsers.md: noVNC webkit bug link format. 2010-09-24 10:46:59 -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 f01e917ecc docs/browsers.md: Separate browser support page. 2010-09-24 09:59:54 -05:00