Skip to content
Andrey Sidorov edited this page May 29, 2013 · 5 revisions
  1. It's crazy! Why?
  • why not? :) It's 50 lines of code to glue node-gif and node-rfb2 + 50 lines of code to add support to node-gif to stream data. It took 30 minutes of my time.
  1. Why gif? It's 2013? Use HTML5/canvas/websockets!
  • This kind of viewers already exist, one popular option is noVNC. There are several benefits in using gif: zero code to download to be able to start displaying updates and very little code to make fully interactive viewer + compatibility with virtually any browser even with javascript disabled

2.1) Why not mjpeg?

  • Gif animation frame represents rectangle of any size at any position in initial gif canvas frame. Mjpeg sends each frame as full image encoded as jpeg. Also, gif encoding works much better for text/line graphics than jpeg.
  1. Why node.js? Why javascript?
  • Because I use it every day and know it well. Because of http://npmjs.org - no matter how complex your idea is chances are you can find couple of pm modules that will do 90% of work for you. Because this is exactly kind of work node.js is good at: take chunk of data from somewhere, transform it and dispatch to somewhere else.
  1. Would it crash my browser? Will it try to keep the whole (growing) image in memory?
  • I don't know. Look at your browser source code. Most likely, yes, it'll try to buffer data into memory or temp file. Because frames are incremental and compressed incoming stream is not too big though in 2013 scale of 'Big': doing find / in full screen terminal (e.i a lot of screen updates) produced about 10Mb of data for me with 1024x768 remote screen in 3 minutes.
  1. It's not interactive! Is it possible to add mouse/keyboard control?
  • Yes, I'm going to create "no js" interactive front end (plain old html form for keystrokes and server side image map for mouse clicks) as well as more traditional and more practical ajax based version. Stay tuned.
  1. Yo have password in url! Aaaa!
  • treat it more as an example. Feel free to implement any authentication/transport you want. It's MIT licensed and open source.
Clone this wiki locally