When moxi is running embedded in the membase cluster, it actually is used into two different modes: as a "gateway" moxi or as a bucket-specific moxi. This is done by just starting moxi processes with different command-line flags, specifically by pointing moxi at (slightly) different URL's. You can use these different URL's when starting your own client-side, standalone moxi's.
The gateway moxi (usually listening on port 11211 when moxi is embedded in membase) handles all SASL authenticated buckets. That is, a client connects to port 11211, and by default, ends up on the default bucket (if it exists and hasn't been deleted). The client can then use binary memcached protocol to SASL authenticate to a different bucket.
The bucket-specific moxi, on the other hand, is already associated with a particular bucket (and this is a bucket that's not already handled by the gateway moxi). For example, a bucket-specific moxi might be listening on port 11212, for the "shoppingCarts" bucket, and as soon as a client connects to port 11212, the client may immediately use any memcached commands (get/set/delete/flush_all/etc) to affect key-value items in that shoppingCarts bucket.
To start a gateway moxi, use a URL of the form: /pools/default/saslBucketsStreaming
For example:
./moxi -Z usr=Administrator,pwd=DontTell http://membase-a:8091/pools/default/saslBucketsStreaming
To start a per-bucket moxi, use a URL of the form: /pools/default/bucketsStreaming/<BUCKET_NAME> For example:
./moxi http://membase-a:8091/pools/default/bucketsStreaming/shoppingCarts