usage

Create an http server listening on PORT given an authorized key list from

`authorized.json`.

straggler -g > keys.json

Generate a keypair for use with `-k`.

straggler -e keys.json [{-r,-w,--rw} NAME, ...]

Generate an entry for the authorized.json file with permissions

(`-r`, `-w`, or `--rw`) for each NAME.

methods

var straggler =require('straggler')

var st = straggler(keys)

Create a new stragger instance st from keys, a public/private keypair
generated by rsa-json.

var rw = st.createStream(uri, cb)

Create a duplex stream rw at uri.

cb(err, rw) fires when the stream is ready or an error occurs.

rw emits an 'open' event when the stream is ready and buffers writes until
the stream is fully opened.

var ws = st.createWriteStream(uri, cb)

Create a writable stream ws at uri.

cb(err, ws) fires when the stream is ready or an error occurs.

ws emits an 'open' event when the stream is ready and buffers writes until
the stream is fully opened.

var rs = st.createReadStream(uri, cb)

Create a readable stream rs at uri.

cb(err, ws) fires when the stream is ready or an error occurs.

rs emits an 'open' event when the stream is fully opened.

var hub = st.createHub(authorized)

Create a straggler hub instance to hook into an http server given
authorized, an array of public key and permissions data.

Hubs are always authorized to read and write from themselves.

In this example authorized data, the first key can write to the '/beep' uri
and the second key can read from the '/beep' uri. "write" and "read"
entries are arrays of paths that may be written to or read from respectively
according to each public key.