Code Monkey home page Code Monkey logo

vnc-over-gif's Introduction

vnc-over-gif

Serves screen updates as animated gif over http. Based on node-gif by Peteris Krumins and node-rfb2

Requirements

  • running vnc server
  • node 0.8 (see issue #2)
  • netscape 2.0+

Installation

npm install -g vnc-over-gif

Usage

start server:

$> PORT=4455 vnc-over-gif

open url in the browser - http://localhost:4455/screen.gif?host=localhost&port=5900&password=secret

Interactivity

Preliminary support has been added for keyboard and mouse interactivity. To use, load the js.html file instead, like so:

http://localhost:4455/js.html?host=localhost&port=5900&password=secret

  • requires Javascript, US layout keyboards
  • events (including keystrokes) are sent to the remote server only when the mouse cursor is over the GIF image (otherwise they're sent to the browser).
  • browser-recognised keystrokes (like Ctrl-N, Ctrl-T, etc) will only be passed through by Firefox -- other browsers don't allow these to be overridden and will fire their usual browser actions.

FAQ

Here

Links

HN discussion

Inspired by this tweet

Animated gif as data transport

Animated gif binary format

JS-only gif encoding libraries: gif.js, omggif

Bitdeli Badge

vnc-over-gif's People

Contributors

floby avatar mlilley avatar sidorares avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vnc-over-gif's Issues

Install error on OS X

Macbook Pro:word_count tibbon$ npm install -g vnc-over-gif
npm http GET https://registry.npmjs.org/vnc-over-gif
npm http 200 https://registry.npmjs.org/vnc-over-gif
npm http GET https://registry.npmjs.org/vnc-over-gif/-/vnc-over-gif-0.0.1.tgz
npm http 200 https://registry.npmjs.org/vnc-over-gif/-/vnc-over-gif-0.0.1.tgz
npm http GET https://registry.npmjs.org/rfb2/0.0.6
npm http 200 https://registry.npmjs.org/rfb2/0.0.6
npm http GET https://registry.npmjs.org/rfb2/-/rfb2-0.0.6.tgz
npm http 200 https://registry.npmjs.org/rfb2/-/rfb2-0.0.6.tgz
npm http GET https://registry.npmjs.org/bindings/1.1.0
npm http 200 https://registry.npmjs.org/bindings/1.1.0
npm http GET https://registry.npmjs.org/bindings/-/bindings-1.1.0.tgz
npm http 200 https://registry.npmjs.org/bindings/-/bindings-1.1.0.tgz

> [email protected] install /usr/local/share/npm/lib/node_modules/vnc-over-gif/node_modules/gif
> node-gyp rebuild

  CC(target) Release/obj.target/giflib/deps/giflib/dgif_lib.o
../deps/giflib/dgif_lib.c:374:23: warning: comparison of integers of different signs:
      'unsigned int' and 'int' [-Wsign-compare]
        for (i = 0; i < GifFile->Image.ColorMap->ColorCount; i++) {
                    ~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
  CC(target) Release/obj.target/giflib/deps/giflib/egif_lib.o
../deps/giflib/egif_lib.c:265:38: warning: comparison of integers of different signs: 'int' and
      'size_t' (aka 'unsigned long') [-Wsign-compare]
              strlen(write_version)) != strlen(write_version)) {
              ~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~
../deps/giflib/egif_lib.c:711:16: warning: comparison of integers of different signs: 'int' and
      'unsigned int' [-Wsign-compare]
               != (unsigned)(CodeBlock[0] + 1)) {
               ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../deps/giflib/egif_lib.c:996:56: warning: comparison of integers of different signs: 'int' and
      'unsigned int' [-Wsign-compare]
            && InternalWrite(GifFile, Buf, Buf[0] + 1) != (unsigned)(Buf[0] + 1)) {
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~
../deps/giflib/egif_lib.c:1009:57: warning: comparison of integers of different signs: 'int' and
      'unsigned int' [-Wsign-compare]
            if (InternalWrite(GifFile, Buf, Buf[0] + 1) != (unsigned)(Buf[0] + 1)) {
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.
  CC(target) Release/obj.target/giflib/deps/giflib/gif_err.o
  CC(target) Release/obj.target/giflib/deps/giflib/gif_font.o
  CC(target) Release/obj.target/giflib/deps/giflib/gif_hash.o
  CC(target) Release/obj.target/giflib/deps/giflib/gifalloc.o
  CC(target) Release/obj.target/giflib/deps/giflib/quantize.o
../deps/giflib/quantize.c:132:25: warning: comparison of integers of different signs:
      'unsigned int' and 'int' [-Wsign-compare]
    if (NewColorMapSize < *ColorMapSize) {
        ~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
../deps/giflib/quantize.c:141:19: warning: comparison of integers of different signs: 'int' and
      'unsigned int' [-Wsign-compare]
    for (i = 0; i < NewColorMapSize; i++) {
                ~ ^ ~~~~~~~~~~~~~~~
2 warnings generated.
  LIBTOOL-STATIC Release/giflib.a
  CXX(target) Release/obj.target/gif/src/animated_gif.o
In file included from ../src/animated_gif.cpp:3:
../src/common.h:27:23: warning: field 'b' will be initialized after field 'color_present'
      [-Wreorder]
        r(rr), g(gg), b(bb), color_present(ccolor_present) {}
                      ^
In file included from ../src/animated_gif.cpp:4:
../src/gif_encoder.h:34:5: warning: 'const' type qualifier on return type has no effect
      [-Wignored-qualifiers]
    const int get_gif_len() const;
    ^~~~~
../src/gif_encoder.h:69:5: warning: 'const' type qualifier on return type has no effect
      [-Wignored-qualifiers]
    const int get_gif_len() const;
    ^~~~~
../src/animated_gif.cpp:31:44: warning: field 'transparency_color' will be initialized after
      field 'data' [-Wreorder]
    gif_encoder(wwidth, hheight, BUF_RGB), transparency_color(0xFF, 0xFF, 0xFE),
                                           ^
../src/animated_gif.cpp:56:13: warning: enumeration values 'BUF_RGBA' and 'BUF_BGRA' not handled
      in switch [-Wswitch]
    switch (buf_type) {
            ^
../src/animated_gif.cpp:79:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
6 warnings generated.
  CXX(target) Release/obj.target/gif/src/async_animated_gif.o
In file included from ../src/async_animated_gif.cpp:4:
../src/common.h:27:23: warning: field 'b' will be initialized after field 'color_present'
      [-Wreorder]
        r(rr), g(gg), b(bb), color_present(ccolor_present) {}
                      ^
In file included from ../src/async_animated_gif.cpp:6:
../src/gif_encoder.h:34:5: warning: 'const' type qualifier on return type has no effect
      [-Wignored-qualifiers]
    const int get_gif_len() const;
    ^~~~~
../src/gif_encoder.h:69:5: warning: 'const' type qualifier on return type has no effect
      [-Wignored-qualifiers]
    const int get_gif_len() const;
    ^~~~~
In file included from ../src/async_animated_gif.cpp:7:
../src/async_animated_gif.h:38:26: error: unknown type name 'eio_req'
    static void EIO_Push(eio_req *req);
                         ^
../src/async_animated_gif.h:39:30: error: unknown type name 'eio_req'
    static int EIO_PushAfter(eio_req *req);
                             ^
../src/async_animated_gif.h:41:28: error: unknown type name 'eio_req'
    static void EIO_Encode(eio_req *req);
                           ^
../src/async_animated_gif.h:42:32: error: unknown type name 'eio_req'
    static int EIO_EncodeAfter(eio_req *req);
                               ^
../src/async_animated_gif.cpp:36:28: error: unknown type name 'eio_req'
AsyncAnimatedGif::EIO_Push(eio_req *req)
                           ^
../src/async_animated_gif.cpp:66:5: warning: unused variable 'scopeGuard66' [-Wunused-variable]
    LOKI_ON_BLOCK_EXIT(fclose, out);
    ^
../src/loki/ScopeGuard.h:662:76: note: expanded from macro 'LOKI_ON_BLOCK_EXIT'
#define LOKI_ON_BLOCK_EXIT      ::Loki::ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) =...
                                                                           ^
../src/loki/ScopeGuard.h:660:59: note: expanded from macro 'LOKI_ANONYMOUS_VARIABLE'
#define LOKI_ANONYMOUS_VARIABLE(str)     LOKI_CONCATENATE(str, __LINE__)
                                                          ^
../src/loki/ScopeGuard.h:659:66: note: expanded from macro 'LOKI_CONCATENATE'
#define LOKI_CONCATENATE(s1, s2)         LOKI_CONCATENATE_DIRECT(s1, s2)
                                                                 ^
../src/loki/ScopeGuard.h:658:42: note: expanded from macro 'LOKI_CONCATENATE_DIRECT'
#define LOKI_CONCATENATE_DIRECT(s1, s2)  s1##s2
                                         ^
<scratch space>:174:1: note: expanded from macro 'scopeGuard'
scopeGuard66
^
../src/async_animated_gif.cpp:82:33: error: unknown type name 'eio_req'
AsyncAnimatedGif::EIO_PushAfter(eio_req *req)
                                ^
../src/async_animated_gif.cpp:84:14: error: use of undeclared identifier 'EV_DEFAULT_UC'
    ev_unref(EV_DEFAULT_UC);
             ^
../src/async_animated_gif.cpp:124:26: error: use of undeclared identifier 'EIO_PRI_DEFAULT'
    eio_custom(EIO_Push, EIO_PRI_DEFAULT, EIO_PushAfter, push_req);
                         ^
../src/async_animated_gif.cpp:125:12: error: use of undeclared identifier 'EV_DEFAULT_UC'
    ev_ref(EV_DEFAULT_UC);
           ^
../src/async_animated_gif.cpp:283:13: warning: enumeration values 'BUF_RGBA' and 'BUF_BGRA' not
      handled in switch [-Wswitch]
    switch (buf_type) {
            ^
../src/async_animated_gif.cpp:281:20: warning: unused variable 'fragmentp' [-Wunused-variable]
    unsigned char *fragmentp = fragment;
                   ^
../src/async_animated_gif.cpp:317:30: error: unknown type name 'eio_req'
AsyncAnimatedGif::EIO_Encode(eio_req *req)
                             ^
../src/async_animated_gif.cpp:328:69: warning: format specifies type 'int' but the argument has
      type 'size_t' (aka 'unsigned long') [-Wformat]
        snprintf(fragment_path, 512, "%s/%d", gif->tmp_dir.c_str(), push_id);
                                         ~~                         ^~~~~~~
                                         %ld
../src/async_animated_gif.cpp:352:39: warning: format specifies type 'int' but the argument has
      type 'size_t' (aka 'unsigned long') [-Wformat]
                gif->tmp_dir.c_str(), push_id, fragments[i]);
                                      ^~~~~~~
../src/async_animated_gif.cpp:361:13: warning: unused variable 'scopeGuard361'
      [-Wunused-variable]
            LOKI_ON_BLOCK_EXIT(fclose, in);
            ^
../src/loki/ScopeGuard.h:662:76: note: expanded from macro 'LOKI_ON_BLOCK_EXIT'
#define LOKI_ON_BLOCK_EXIT      ::Loki::ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) =...
                                                                           ^
../src/loki/ScopeGuard.h:660:59: note: expanded from macro 'LOKI_ANONYMOUS_VARIABLE'
#define LOKI_ANONYMOUS_VARIABLE(str)     LOKI_CONCATENATE(str, __LINE__)
                                                          ^
../src/loki/ScopeGuard.h:659:66: note: expanded from macro 'LOKI_CONCATENATE'
#define LOKI_CONCATENATE(s1, s2)         LOKI_CONCATENATE_DIRECT(s1, s2)
                                                                 ^
../src/loki/ScopeGuard.h:658:42: note: expanded from macro 'LOKI_CONCATENATE_DIRECT'
#define LOKI_CONCATENATE_DIRECT(s1, s2)  s1##s2
                                         ^
<scratch space>:174:1: note: expanded from macro 'scopeGuard'
scopeGuard361
^
../src/async_animated_gif.cpp:364:13: warning: unused variable 'scopeGuard364'
      [-Wunused-variable]
            LOKI_ON_BLOCK_EXIT(free, data);
            ^
../src/loki/ScopeGuard.h:662:76: note: expanded from macro 'LOKI_ON_BLOCK_EXIT'
#define LOKI_ON_BLOCK_EXIT      ::Loki::ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) =...
                                                                           ^
../src/loki/ScopeGuard.h:660:59: note: expanded from macro 'LOKI_ANONYMOUS_VARIABLE'
#define LOKI_ANONYMOUS_VARIABLE(str)     LOKI_CONCATENATE(str, __LINE__)
                                                          ^
../src/loki/ScopeGuard.h:659:66: note: expanded from macro 'LOKI_CONCATENATE'
#define LOKI_CONCATENATE(s1, s2)         LOKI_CONCATENATE_DIRECT(s1, s2)
                                                                 ^
../src/loki/ScopeGuard.h:658:42: note: expanded from macro 'LOKI_CONCATENATE_DIRECT'
#define LOKI_CONCATENATE_DIRECT(s1, s2)  s1##s2
                                         ^
<scratch space>:174:1: note: expanded from macro 'scopeGuard'
scopeGuard364
^
../src/async_animated_gif.cpp:344:9: warning: unused variable 'scopeGuard344' [-Wunused-variable]
        LOKI_ON_BLOCK_EXIT(free, frame);
        ^
../src/loki/ScopeGuard.h:662:76: note: expanded from macro 'LOKI_ON_BLOCK_EXIT'
#define LOKI_ON_BLOCK_EXIT      ::Loki::ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) =...
                                                                           ^
../src/loki/ScopeGuard.h:660:59: note: expanded from macro 'LOKI_ANONYMOUS_VARIABLE'
#define LOKI_ANONYMOUS_VARIABLE(str)     LOKI_CONCATENATE(str, __LINE__)
                                                          ^
../src/loki/ScopeGuard.h:659:66: note: expanded from macro 'LOKI_CONCATENATE'
#define LOKI_CONCATENATE(s1, s2)         LOKI_CONCATENATE_DIRECT(s1, s2)
                                                                 ^
../src/loki/ScopeGuard.h:658:42: note: expanded from macro 'LOKI_CONCATENATE_DIRECT'
#define LOKI_CONCATENATE_DIRECT(s1, s2)  s1##s2
                                         ^
<scratch space>:174:1: note: expanded from macro 'scopeGuard'
scopeGuard344
^
../src/async_animated_gif.cpp:338:9: warning: unused variable 'scopeGuard338' [-Wunused-variable]
        LOKI_ON_BLOCK_EXIT(free_file_list, fragments);
        ^
../src/loki/ScopeGuard.h:662:76: note: expanded from macro 'LOKI_ON_BLOCK_EXIT'
#define LOKI_ON_BLOCK_EXIT      ::Loki::ScopeGuard LOKI_ANONYMOUS_VARIABLE(scopeGuard) =...
                                                                           ^
../src/loki/ScopeGuard.h:660:59: note: expanded from macro 'LOKI_ANONYMOUS_VARIABLE'
#define LOKI_ANONYMOUS_VARIABLE(str)     LOKI_CONCATENATE(str, __LINE__)
                                                          ^
../src/loki/ScopeGuard.h:659:66: note: expanded from macro 'LOKI_CONCATENATE'
#define LOKI_CONCATENATE(s1, s2)         LOKI_CONCATENATE_DIRECT(s1, s2)
                                                                 ^
../src/loki/ScopeGuard.h:658:42: note: expanded from macro 'LOKI_CONCATENATE_DIRECT'
#define LOKI_CONCATENATE_DIRECT(s1, s2)  s1##s2
                                         ^
<scratch space>:174:1: note: expanded from macro 'scopeGuard'
scopeGuard338
^
../src/async_animated_gif.cpp:384:35: error: unknown type name 'eio_req'
AsyncAnimatedGif::EIO_EncodeAfter(eio_req *req)
                                  ^
../src/async_animated_gif.cpp:388:14: error: use of undeclared identifier 'EV_DEFAULT_UC'
    ev_unref(EV_DEFAULT_UC);
             ^
../src/async_animated_gif.cpp:439:28: error: use of undeclared identifier 'EIO_PRI_DEFAULT'
    eio_custom(EIO_Encode, EIO_PRI_DEFAULT, EIO_EncodeAfter, enc_req);
                           ^
../src/async_animated_gif.cpp:441:12: error: use of undeclared identifier 'EV_DEFAULT_UC'
    ev_ref(EV_DEFAULT_UC);
           ^
12 warnings and 14 errors generated.
make: *** [Release/obj.target/gif/src/async_animated_gif.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/Cellar/node/0.10.5/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Darwin 12.3.0
gyp ERR! command "node" "/usr/local/Cellar/node/0.10.5/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/share/npm/lib/node_modules/vnc-over-gif/node_modules/gif
gyp ERR! node -v v0.10.5
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok 
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the gif package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls gif
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 12.3.0
npm ERR! command "/usr/local/Cellar/node/0.10.5/bin/node" "/usr/local/bin/npm" "install" "-g" "vnc-over-gif"
npm ERR! cwd /Users/tibbon/Code/word_count
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/tibbon/Code/word_count/npm-debug.log
npm ERR! not ok code 0
Macbook Pro:word_count tibbon$ 

install fails on gif package (workaround)

Looks like there is a few problems with the gif package dependency at the moment (requires node 0.8, broken c++ source).

As a heads-up to get going until the gif problem is fixed, it might be worth sharing the workaround I wound up with:

  • as the readme suggests, use node 0.8 (or possibly 0.9)
  • clone the node-gif package repo
  • modify /path/to/nodegifrepo/src/gif_encoder.cpp adding "#define FALSE 0" somewhere near the top to fix the compile error.
  • manually compile: cd /path/to/nodegifrepo/ ; node-gyp configure ; node-gyp build
  • modify vnc-over-gif.js to require the compiled gif.node binary directly: require('gif') => require('./path/to/nodegifrepo/build/Release/gif.node')

(on ubuntu 12.04, node 0.8.23, vnc-over-gif 0.0.2 (with gif 2.0.2 dependency))

Crashes with ECONNREFUSED on OS X

On OSX 10.7.5, node version 0.8.15 (which I realize is old - will update and retry)

When I run vnc-over-gif and try to connect to `http://localhost:4444/screen.gif', it crashes with the following message:

events.js:71
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: connect ECONNREFUSED
    at errnoException (net.js:769:11)
    at Object.afterConnect [as oncomplete] (net.js:760:19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.