2.0.1 • Published 9 years ago

hidden-server v2.0.1

Weekly downloads
28
License
-
Repository
github
Last release
9 years ago

hidden-server

talk to public-server in order to execute client commands

use case: access server sitting behind firewalls with unknown ip-address via reverse tunnel on demand.

documentation

the hidden-server is the counter part of public-server. to keep things less redundant, the documentation can be found here: public-server

install

npm install hidden-server

##usage

full examples can be found here: public-server/examples

###with roundtrip

var HiddenServer = require('hidden-server');
var hidden = new HiddenServer({
  publicServer: 'http://localhost:3000',
  pingUri: '/ping/:hiddenServerName',
  simultaneousPings: 3,
  pingInterval: 5,
  keepPingOpen: true,
  roundTripResponse: true,
  hiddenServerName: 'server1'
}).start();

hidden.on('command', function(obj, cb) {
  console.log('got command', obj);
  // simulate async response
  setTimeout(function() {
    obj.response = "are you sure about: " + obj.command;
    console.log('parameters', obj, cb);
    if (cb) cb(obj);
  }, 0);
});

###without roundtrip

var HiddenServer = require('hidden-server');
var hidden = new HiddenServer({
  publicServer: 'http://localhost:3000',
  pingUri: '/ping/:hiddenServerName',
  simultaneousPings: 5,
  pingInterval: 3,
  keepPingOpen: true,
  roundTripResponse: false,
  hiddenServerName: 'server1'
}).start();


hidden.on('command', function(obj) {
  console.log('command', obj);
});

##test

tests can be found here: public-server/test

license

MIT License

2.0.1

9 years ago

2.0.0

10 years ago

1.1.3

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

0.0.1

10 years ago