You can optionally pass in an opts.router to use. The API of opts.router
should match the routes module.

Passing in a custom opts.route is useful if you want to define your routes
outside of a connection callback more similarly to how http routers are
typically used. Consult the example/router directory for an example.

The opts.maxDepth you specify will be passed directly through to
multiplex. You might need to adjust this
value if you generate many hundreds of events simultaneously on different
streams.

You can give an opts.missing function as a catch-all fallback route.
opts.missing(pathname) is called with the route pathname string and should
return a stream like any other route. If the missing stream emits errors, these
errors are serialized like any other stream error.

Note that plex emits and consumes binary data, so whatever connection you pipe
data through must be binary-capable. This can sometimes be a problem in the
browser with string-encoded transports, but you use base64 to avoid issues with
binary-incapable transports.
See also: shoe-bin.

pattern may contain parameters according to the syntax used by the
routes module. These parameters and other
parameters supplied to open(), remote(), or local() will be available to
the fn(opts, cb) function as the opts.

fn(opts, cb) will be called when the route is opened.
fn should return a stream (readable, writable, or duplex) or it may call
cb(err, result), with a single result to send on the outgoing stream.

If the stream returned by fn emits an error, that error object will be
serialized and sent to the consumer of that pathname on the 'error' event.

If cb(err) is called with an error, the error is serialized and sent on the
remote stream's 'error' event.

When the remote stream closes, when an error occurs, or when the remote calls
stream.destroy(), a '_close' event fires on the stream object returned by
fn. stream.destroy() generates a '_destroy' event in addition to the
'_close' event.