listen-connect
listen and connect methods for exposing a duplex stream to the network
This was extracted from dnode
Example
var listenConnect =rpcServerlisten = listenConnectrpcClientconnect = listenConnectrpcServerrpcClient
Usage
port/host/path arguments parsed with parse-connection-args
listenConnect.createListen(fn)
Returns a listen
function that accepts port/host/path arguments. When called it will create a new server with net.createServer
and expose the stream on the provided port/host/path.
var listen = listenConnectvar server =// Clean up server with closeserver
listenConnect.createConnect(fn)
Returns a connect
function that accepts port/host/path arguments. When called it will create a new connection, with net.connect
, to the provided port/host/path.
var connect = listenConnectvar client =// Clean up client with destroyclient
License
MIT