pingpong

Dead simple RPC with response support

pingpong.js

Dead simple RPC with response support.

npm install pingpong

Allows a client side function to invoke a server side function with some arguments and an optional callback. The server can err or answer on the callback.

That's it.

Server:

var pingpong = require('pingpong');
 
pingpong.server(8000, function (errserver) {
 
  server.onConnect(function (client) {
    client.onMessage(function (textresponder) {
      responder(null, text.toUpperCase());
    });
  });
 
});

Client:

var pingpong = require('pingpong');
 
pingpong.client({ port : 8000 }, function (errremote) {
  remote.invoke('Hello world!', function (errresult) {
    console.log(result);
  });
});

Prints HELLO WORLD!.

Run echo.sh from within the examples directory to see it in action.