npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rfb2

v0.2.2

Published

RFB protocol client and server

Downloads

735

Readme

node-rfb2

RFB wire protocol client and server

var rfb = require('rfb2');
var r = rfb.createConnection({
  host: '127.0.0.1',
  port: 5900,
  password: 'secret'
});

r.on('connect', function() {
  console.log('successfully connected and authorised');
  console.log('remote screen name: ' + r.title + ' width:' + r.width + ' height: ' + r.height);
});

r.on('error', function(error) {
  throw new Error(error);
});

r.pointerEvent(100, 100, 0); // x, y, button state (bit mask for each mouse button)
r.keyEvent(40, 0);           // keycode, is down?
r.updateClipboard('send text to remote clipboard');

// screen updates
r.on('rect', function(rect) {
   switch(rect.encoding) {
   rfb.encodings.raw:
      // rect.x, rect.y, rect.width, rect.height, rect.data
      // pixmap format is in r.bpp, r.depth, r.redMask, greenMask, blueMask, redShift, greenShift, blueShift
   rfb.encodings.copyRect:
      // pseudo-rectangle
      // copy rectangle from rect.src.x, rect.src.y, rect.width, rect.height, to rect.x, rect.y
   rfb.encodings.hextile:
      // not fully implemented
      rect.on('tile', handleHextileTile); // emitted for each subtile
   }
});

r.on('resize', function(rect) {
  console.log('window size has been resized! Width: %s, Height: %s', rect.width, rect.height);
});

r.on('clipboard', function(newPasteBufData) {
  console.log('remote clipboard updated!', newPasteBufData);
});

r.on('bell', console.log.bind(null, 'Bell!!'));

// force update
// updates are requested automatically after each new received update
// you may want to have more frequent updates for high latency / high bandwith connection
r.requestUpdate(false, 0, 0, r.width, r.height); // incremental?, x, y, w, h

r.end(); // close connection

Status:

Ready

  • pointer, keyboard, cutText, requestUpdate client messages
  • colormap, bell, cutText server messages
  • Raw FB update encoding
  • pseudoDesktopSize and copyRect pseudo rect updates
  • record/replay to/from file

In progress:

  • Hextile encoding support
  • Server side protocol

TODO:

  • ZRle, RRE, CoRRE, Zlib, Tight encodings
  • ARD and MS security types
  • VNC server with x11 and COMPOSITE/DAMAGE extensions

see also:

Bitdeli Badge