Commit Graph

1775 Commits

Author SHA1 Message Date
Joel Martin 1506a5ed54 Clarify license on arrays test files. 2011-02-23 14:48:23 -06:00
Joel Martin d3da7c4c4f Add Javascript binary byte array test.
Compares normal Javascript arrays with Canvas ImageData arrays and
Typed Arrays (ArrayBuffers from WebGL).
2011-02-23 11:08:09 -06:00
Joel Martin 43cf7bd83b Some JSLint'ing 2011-02-19 16:44:10 -06:00
Joel Martin 9b8f457b6b Add OpenNode to README. Update TODOs. 2011-02-05 13:03:12 -06:00
Joel Martin 159ad55d03 Add logo, favicon.
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.
2011-02-03 11:04:32 -06:00
Joel Martin 0f354fb682 Fix CSS sizes with HTML5 doctype.
Using HTML5 doctype means CSS pixels sizes must have "px" suffix which
many of them did not. Fix that.
2011-02-02 10:48:29 -06:00
Joel Martin 215ae8e564 Better reaper, catch occasional bad WS header line.
Call waitpid in loop to catch SIGCHLD signals that happen while
handling the original SIGCHLD signal.

Pulled from websockify.
2011-02-01 10:47:45 -06:00
Joel Martin ec2b614037 Pull websockify: zombie reap, ignore unready clients. 2011-01-31 12:13:30 -06:00
Joel Martin 40f281ebbd Add DOCTYPE. Misc cleanup. 2011-01-30 23:42:28 -06:00
Joel Martin 0981845ec4 IE9 fixes. Works but slow. API change.
API change: changed include path variable from VNC_uri_prefix to
URI_INCLUDE since websock.js uses the variable and websock.js is no
longer just for noVNC (i.e. websockify is really the canonical
location for websock.js).

Changes to get web-socket-js to work. Right now it's a hack to get
around: https://github.com/gimite/web-socket-js/issues#issue/41. The
hack is to disable caching of the flash objects by appending
"?" + Math.random() to the end of the flash object path (but only when
using IE).
2011-01-30 22:58:22 -06:00
Joel Martin 7cc5fbc52e Opera 11 WebSockets and Opera '-' key mapping fix.
Opera 11 native WebSockets (if enabled) seems to have bad behavior for
the bufferedAmount so add change from websockify project to allow max
bufferedAmount (before send queue is delay) to be configured.

Also, Opera 11 and 10.60 behave like Mozilla regarding the '-' key so
translate it correctly.
2011-01-23 19:36:11 -06:00
Joel Martin 1756a30a48 websock.send returns true/false.
If all send data was flushed from the send queue then return true,
otherwise false. This doesn't mean the data won't be sent, just that
it wasn't sent this time and is queued.
2011-01-23 19:21:04 -06:00
Joel Martin 8b502df2a1 Tolerate some bufferedAmount.
Only delay sending data if bufferedAmount is greater than 1000.

This seems to match the intention of the spec better. bufferedAmount
does not mean that we can't send, it's just an indication that the
network is becoming saturated. But Opera 11 native WebSockets seems to
have a bug that bufferedAmount isn't set back to zero correctly so
we'll be a bit more tolerant.
2011-01-23 19:17:59 -06:00
Joel Martin cabecf8964 canvas.js: prevent Opera keyboard event bubbling.
Issue #8: https://github.com/kanaka/noVNC/issues#issue/8
2011-01-19 13:09:32 -06:00
Joel Martin b43c9838a5 web-socket-js: Add function invocation fix.
Related to this issue:
https://github.com/gimite/web-socket-js/issues/#issue/50

This prevents the "Uncaught exception: TypeError:
'this.__handleEvents' is not a function" everytime the timer fires.

Yay, one of Javascript's worst behaviors; the way it sets "this".
2011-01-19 13:01:28 -06:00
Joel Martin 9a23006e7a include/canvas.js: fix changeCursor data format.
Issues #27 (safari cursor rendering messed up) and #29 (firefox 3.6.10
segault).

Finally found some better reference on the icon/cursor format which is
added to the docs/links file.

It seems like I was missing the XOR section. So setting the cursor
would cause corruptin in Safari rendering or the segfault for firefox.
2011-01-18 23:22:25 -06:00
Joel Martin 9df83a3953 Move advanced, integration, troubleshoot to wiki.
Move the Advanced Usage, Integration and Troubleshooting sections to
their own pages in the wiki.

Also, update wsproxy.py referneces to be websockify.
2011-01-18 14:19:55 -06:00
Joel Martin 2840026468 include/canvas.js: add numpad support to getKeysym.
Check keyLocation and translate numpad keys into numbers. keyLocation
is not widely supported yet, but it should start percolating into
browsers eventually:
http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent

This change is based on:
8e59e3772c
2011-01-18 12:16:50 -06:00
Joel Martin 0a9f04241e Move browsers.md to Wiki.
It is now here: https://github.com/kanaka/noVNC/wiki/Browser-support
2011-01-18 11:58:24 -06:00
Joel Martin febae871ab tests/vnc_perf.html: load from data/multi.js
To go along with addition of performance notes to the website.
2011-01-17 11:46:55 -06:00
Joel Martin 30b0c00875 Misc docs/{TODO,links} updates. 2011-01-16 19:27:32 -06:00
Joel Martin 24d01a5aa4 Update gimite/web-socket-js build.
Update to a build based on 20f837425d4 from gimite/web-socket-js.

This changes the event handling code and fixes the frequent recursive
call into Flash errors.
2011-01-16 19:05:58 -06:00
Joel Martin 1b097a63a3 Fix strict mode complaints in firefox 4. 2011-01-16 18:57:45 -06:00
Joel Martin 72f1348b35 Convert to Websock library.
Copy in include/websock.js from websockify and use that instead. Still
some cleanup of network code but it's a good start.
2011-01-13 00:30:08 -06:00
Joel Martin 61265b3a7f Remove files that are now in websockify.
https://github.com/kanaka/websockify is now the canonical location of
websockify (formerly wsproxy). A copy of the python version is kept
here for backwards compatibility and ease-of-use. The other versions
and related test scripts are in websockify.
2011-01-12 20:31:04 -06:00
Joel Martin 66937e399a wsproxy.py: python2.4 fixes. 2011-01-12 18:12:17 -06:00
Joel Martin c32e00c67f wstelnet: forgot VT100.js. 2011-01-12 17:09:33 -06:00
Joel Martin 932e7318b9 Minor correct to wstelnet.js header comment. 2011-01-12 16:55:31 -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 86725f9b4c wswrapper: add dup2, fix select w/ NULL timeout.
- 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.
2011-01-08 21:46:36 -06:00
Joel Martin 6a88340929 Refactor and cleanup websocket.py and deps.
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.
2011-01-08 15:29:01 -06:00
Joel Martin 6ace64d3ae utils/README.md: horizontal looks better.
Flip table back to be horizontal. More readable.
2011-01-06 19:21:17 -06:00
Joel Martin 90966d6251 utils/README.md: flip table. Add web server info.
Flip the feature table to be tall instead of wide.

Added row about "web server" functionality in wsproxy.py.
2011-01-06 19:17:32 -06:00
Joel Martin 9aaf26e878 Merge branch 'master' of git@github.com:kanaka/noVNC 2011-01-06 19:13:39 -06:00
Joel Martin 02a7dd2c29 Merge branch 'master' of git@github.com:kanaka/noVNC 2011-01-06 17:33:22 -07: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 58dc1947de wsproxy: warn when no cert. C sock close cleanup.
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.
2011-01-04 13:14:46 -06:00
Joel Martin 58da507bb8 README: add companies/projects using noVNC. 2011-01-04 12:19:54 -06:00
Joel Martin 9b940131d3 include/canvas.js: show full user agent in console. 2011-01-04 10:30:26 -06:00
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 2574936f60 utils/README.md, docs/TODO, docs/notes: updates.
Add wswrapper info to utils/README.md and docs/TODO. Remove innacurate
info from docs/notes.
2010-12-30 11:00:50 -07:00
Joel Martin 71ba9a7a54 wswrapper: update README, DO_MSG def for output.
Update README to mention wswrapper. Add DO_MSG define which controls
whether wswrapper code generates basic output.
2010-12-29 14:11:28 -07: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