@cryptix you don't have to remap every packet, just the packets that start a new request/stream. After that, you would just have a table to map the request number on connection to another. If you wanted to get really tricky, you could just take the incoming buffer and rewrite the request number, then send it. But I expect for security enforcement, it may be desireable to do some packet inspection. Although, probably it should mainly be done on the first packets though, since that is where the arguments are set. Then you could for example, have a plugin that is allowed to publish new messages, but only a given type.
localCall
is a method that get called with the raw data from a new request, and it's responsible for gluing muxrpc to your actual api. so type is stream/async/sync, name is the path to the method, and args is the arguments to call with. It either calls the function & callback or returns a stream, or throws an error.