Skip to content

Instantly share code, notes, and snippets.

@pkrumins
Created January 8, 2011 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pkrumins/770671 to your computer and use it in GitHub Desktop.
Save pkrumins/770671 to your computer and use it in GitHub Desktop.
// server.js
var dnode = require('dnode');
function Manager () {
var desktops = {};
var self = this;
this.spawn = function (name) {
desktops[name] = "yep";
}
this.resolution = function (name) {
console.log(desktops[name]);
}
}
dnode(Manager).listen(31337);
// client.js
var dnode = require('dnode');
dnode.connect(31337, function (remote) {
remote.spawn('hello');
});
dnode.connect(31337, function (remote) {
remote.resolution('hello');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment