npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

aegis-fluxion

v0.7.6

Published

Umbrella package for the aegis-fluxion E2E encrypted WebSocket toolkit.

Readme

aegis-fluxion

Main end-user package for the aegis-fluxion secure messaging ecosystem.

Version: 0.7.6


Re-exported modules

aegis-fluxion re-exports all public APIs from:

  • @aegis-fluxion/core
  • @aegis-fluxion/browser-client
  • @aegis-fluxion/mcp-adapter
  • @aegis-fluxion/redis-adapter

This means you can build encrypted transport, MCP bridges, and Redis-based horizontal scaling without multiple package-level imports.


What's new in 0.7.6

  • Observability & Telemetry support landed in @aegis-fluxion/core@^0.10.0.
  • SecureServer now exposes:
    • getMetrics() JSON snapshots
    • getMetricsPrometheus() Prometheus-friendly output
  • Telemetry includes active connection gauge, handshake counters, encrypted message traffic, and blocked DDoS/rate-limit counters.

Install

npm install aegis-fluxion ws redis

Quick start

import { SecureClient, SecureServer } from "aegis-fluxion";

const server = new SecureServer({ host: "127.0.0.1", port: 8080 });

server.on("tasks:create", async (payload) => {
  return {
    ok: true,
    payload
  };
});

const client = new SecureClient("ws://127.0.0.1:8080");

client.on("ready", async () => {
  const response = await client.emit("tasks:create", { id: "t-1" }, { timeoutMs: 1200 });
  console.log(response);
});

Observability quick example

import { createServer } from "node:http";
import { SecureServer } from "aegis-fluxion";

const secureServer = new SecureServer({ host: "127.0.0.1", port: 8080 });

createServer((request, response) => {
  if (request.url === "/metrics") {
    response.setHeader("Content-Type", "text/plain; version=0.0.4; charset=utf-8");
    response.end(secureServer.getMetricsPrometheus());
    return;
  }

  if (request.url === "/metrics.json") {
    response.setHeader("Content-Type", "application/json; charset=utf-8");
    response.end(JSON.stringify(secureServer.getMetrics(), null, 2));
    return;
  }

  response.statusCode = 404;
  response.end("Not Found");
}).listen(9100, "127.0.0.1");

Frontend React quick example

import { useEffect, useMemo, useState } from "react";
import { BrowserSecureClient } from "aegis-fluxion";

export function SecureTimeline() {
  const [status, setStatus] = useState("connecting");

  const client = useMemo(() => {
    return new BrowserSecureClient("wss://api.example.com/socket", {
      autoConnect: false,
      reconnect: true
    });
  }, []);

  useEffect(() => {
    const handleReady = () => setStatus("ready");
    const handleDisconnect = () => setStatus("disconnected");

    client.on("ready", handleReady);
    client.on("disconnect", handleDisconnect);
    client.connect();

    return () => {
      client.off("ready", handleReady);
      client.off("disconnect", handleDisconnect);
      client.disconnect();
    };
  }, [client]);

  return <p>Secure browser socket status: {status}</p>;
}

Session resumption quick example

import { SecureClient, SecureServer } from "aegis-fluxion";

const server = new SecureServer({
  host: "127.0.0.1",
  port: 8080,
  sessionResumption: {
    enabled: true,
    ticketTtlMs: 60_000,
    maxCachedTickets: 2_048
  }
});

const client = new SecureClient("ws://127.0.0.1:8080", {
  reconnect: true,
  sessionResumption: {
    enabled: true,
    maxAcceptedTicketTtlMs: 60_000
  }
});

client.on("ready", () => {
  console.log("Secure channel is ready (resumed or full handshake).");
});

Chunked streaming quick example

import { SecureClient, SecureServer } from "aegis-fluxion";

const server = new SecureServer({ host: "127.0.0.1", port: 8080 });
const client = new SecureClient("ws://127.0.0.1:8080");

server.onStream("blob:upload", async (stream, info) => {
  const chunks: Buffer[] = [];

  for await (const chunk of stream) {
    chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
  }

  const fullBuffer = Buffer.concat(chunks);

  console.log("Received stream", {
    streamId: info.streamId,
    announcedTotalBytes: info.totalBytes,
    receivedBytes: fullBuffer.length
  });
});

client.on("ready", async () => {
  const payload = Buffer.from("large payload");

  const result = await client.emitStream("blob:upload", payload, {
    chunkSizeBytes: 64 * 1024,
    totalBytes: payload.length,
    metadata: { source: "client" }
  });

  console.log(result);
});

Horizontal scaling example (Redis adapter)

import {
  RedisSecureServerAdapter,
  SecureServer
} from "aegis-fluxion";

const redisUrl = "redis://127.0.0.1:6379";
const channel = "aegis-fluxion:cluster:prod";

const adapterA = new RedisSecureServerAdapter({ redisUrl, channel });
const adapterB = new RedisSecureServerAdapter({ redisUrl, channel });

const serverA = new SecureServer({
  host: "127.0.0.1",
  port: 8081,
  adapter: adapterA
});

const serverB = new SecureServer({
  host: "127.0.0.1",
  port: 8082,
  adapter: adapterB
});

serverA.on("connection", (client) => client.join("alerts"));
serverB.on("connection", (client) => client.join("alerts"));

serverA.to("alerts").emit("alerts:new", {
  level: "info",
  source: "server-a"
});

MCP transport example

import {
  SecureClient,
  SecureMCPTransport,
  SecureServer,
  type SecureMCPMessage
} from "aegis-fluxion";

const secureServer = new SecureServer({ host: "127.0.0.1", port: 9092 });

secureServer.on("connection", async (client) => {
  const serverTransport = new SecureMCPTransport({
    mode: "server",
    server: secureServer,
    clientId: client.id
  });

  serverTransport.onmessage = async (message: SecureMCPMessage) => {
    console.log("Server MCP message", message);
  };

  await serverTransport.start();
});

const secureClient = new SecureClient("ws://127.0.0.1:9092");

const clientTransport = new SecureMCPTransport({
  mode: "client",
  client: secureClient
});

await clientTransport.start();
await clientTransport.send({
  jsonrpc: "2.0",
  id: 1,
  method: "tools/list",
  params: {}
});

Related documentation


License

MIT