
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@synadiaorbit/muxsub
Advanced tools
A NATS multiplexing subscription utility that allows multiple message handlers to share a single underlying subscription using inbox-based routing.
MuxSub creates a single wildcard subscription on a generated inbox prefix (e.g.,
_INBOX.abc123.>
), then routes incoming messages to specific handlers based on
the message subject tokens. This approach reduces the number of subscriptions
while maintaining clean message handling separation.
# Deno
deno add @synadiaorbit/muxsub
# Import in your code
import { MuxSubscription } from "@synadiaorbit/muxsub";
import { wsconnect } from "@nats-io/nats-core";
import { MuxSubscription } from "@synadiaorbit/muxsub";
const nc = await wsconnect({ servers: ["nats://localhost:4222"] });
const mux = new MuxSubscription(nc);
// Callback-based handler
mux.newMuxInbox("foo.bar", (_, msg) => {
console.log("Received:", msg.subject);
});
// Iterator-based handler
const iterator = mux.newMuxInbox("responses");
for await (const msg of iterator) {
console.log("Response:", msg.subject);
break; // Exit after first message
}
// Publish to handlers
nc.publish(mux.subjectFor("foo.bar"), "hello");
nc.publish(mux.subjectFor("responses"), "world");
await mux.drain();
await nc.close();
new MuxSubscription(nc: NatsConnection)
- Creates a new multiplexing
subscriptionnewMuxInbox(subject: string, callback: MsgCallback)
- Register a callback
handlernewMuxInbox(subject: string)
- Create an async iterator for messagescancelMuxInbox(subject: string)
- Remove a handlersubjectFor(partialSubject: string)
- Get the full NATS subject for
publishingtokenFor(subject: string)
- Extract the token from a full subjectdrain()
- Gracefully close after processing pending messagesunsubscribe(max?: number)
- Stop the subscriptionclosed
- Promise that resolves when subscription closesisDraining()
- Check if subscription is drainingisClosed()
- Check if subscription is closed{prefix}.>
where {prefix}
is a generated
inboxApache License 2.0
FAQs
muxsub - multiplexed NATS subscriptions
We found that @synadiaorbit/muxsub demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.