p2p-rpc-stream
Transport-agnostic RPC libraries utilizing node streams have already become quite popular. In my opinion, there is still a problem, though: What if I need to call methods from both ends? Create tow tcp servers? Ugly.
This little library provides RPC streams that you can use to do traditional client/server or to communicate between peers (both sides act as client & server).
var rpc = net = // This node both// a server ... var server = rpc net
var rpc = net = var client = rpc var sock = net
Install
npm install p2p-rpc-stream
Todo
- allow custom request timeouts
Legal
(c) 2013 by Marcel Klehr
MIT License