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

@blockcast/transport

v0.2.0

Published

Unified transport manager for MoQ with WebTransport, SSM multicast, AMT, DRIAD, and FEC support

Downloads

127

Readme

@blockcast/transport

Unified transport manager for MoQ with WebTransport, SSM multicast, AMT, DRIAD, and FEC support.

Features

  • Transport Hierarchy: Automatic fallback from native SSM → IGMP → AMT → DRIAD → MOQ
  • Adaptive Bitrate: Progressive quality upgrade based on network conditions
  • FEC Recovery: RaptorQ-based forward error correction for lossy paths
  • A/V Sync: SharedClock for cross-track synchronization
  • DRIAD Discovery: RFC 8777 relay discovery via DNS-over-HTTPS

Installation

pnpm add @blockcast/transport

Usage

Basic SSM Transport

import { ssmTransport } from '@blockcast/transport';

// Set up callbacks
ssmTransport.setPacketCallback((data) => {
  console.log('Received packet:', data.byteLength, 'bytes');
});

ssmTransport.setStateCallback((state) => {
  console.log('Transport state:', state.mode, state.connected);
});

// Connect to multicast stream
await ssmTransport.connect({
  group: '232.1.1.1',
  source: '192.168.1.100',
  port: 5000,
  streamType: 'video',
  driadEnabled: true,
});

// Get current state
const state = ssmTransport.getState();
console.log(`Mode: ${state.mode}, Packets: ${state.packetsReceived}`);

// Disconnect
ssmTransport.disconnect();

With FEC Recovery

import { MmtFecClient, createMulticastFecHandler } from '@blockcast/transport/fec';

// Create FEC client
const fecClient = new MmtFecClient({
  interleaveDepth: 30,
  blockTimeoutMs: 2000,
  greenFillEnabled: true,
  onMfuReady: (mfu) => {
    console.log('MFU ready:', mfu.mpuSequenceNumber);
    if (mfu.recoveredViaFec) {
      console.log('Recovered via FEC!');
    }
  },
});

// Set WASM module (from libmmt)
fecClient.setWasmModule(mmtWasmModule);
await fecClient.init();

// Create packet handler for window.Multicast
const handler = createMulticastFecHandler(fecClient);
window.Multicast.subscribeSSM({
  group: '232.1.1.1',
  source: '192.168.1.100',
  port: 5000,
}).then(sub => {
  sub.onpacket = (event) => handler(event.data);
});

A/V Synchronization

import { getSharedClock } from '@blockcast/transport/clock';

const clock = getSharedClock();

// Set anchor on first keyframe
clock.setAnchor(firstFrame.timestamp);

// Check if frame should be rendered
const decision = clock.shouldRender(frame.timestamp);
if (decision === 'render') {
  renderFrame(frame);
} else if (decision === 'hold') {
  const waitMs = clock.getWaitTimeMs(frame.timestamp);
  await sleep(waitMs);
  renderFrame(frame);
} else {
  // discard - frame is too late
  frame.close();
}

DRIAD Discovery

import { driadDiscovery } from '@blockcast/transport';

// Discover AMT relays for a multicast group
const relays = await driadDiscovery.discoverRelays('232.1.1.1');
const bestRelay = await driadDiscovery.selectBestRelay(relays);

console.log(`Best relay: ${bestRelay.host}:${bestRelay.port} (RTT: ${bestRelay.rtt}ms)`);

Direct AMT Gateway

import { AMTGateway } from '@blockcast/transport';

const gateway = new AMTGateway({
  relayAddress: 'amt-relay.example.com',
  relayPort: 2268,
  onPacket: (packet) => {
    console.log('Received:', packet.data.length, 'bytes from', packet.srcAddress);
  },
  onStateChange: (newState, oldState) => {
    console.log(`State: ${oldState} -> ${newState}`);
  },
});

// Join multicast group
await gateway.joinGroup('232.1.1.1', 5000, '192.168.1.100');
await gateway.open();

// Later...
await gateway.close();

Quality Levels

The adaptive bitrate controller supports these quality levels:

| Name | Bitrate | Resolution | FPS | |------|---------|------------|-----| | 240p | 300 Kbps | 426x240 | 15 | | 360p | 500 Kbps | 640x360 | 24 | | 480p | 1 Mbps | 854x480 | 30 | | 720p | 2.5 Mbps | 1280x720 | 30 | | 1080p | 5 Mbps | 1920x1080 | 30 | | 1440p | 8 Mbps | 2560x1440 | 30 | | 4K | 15 Mbps | 3840x2160 | 30 |

Transport Modes

| Mode | Description | Requirements | |------|-------------|--------------| | ssm | Native Source-Specific Multicast | IWA + Direct Sockets | | igmp | Native Any-Source Multicast | IWA + Direct Sockets | | amt | AMT Gateway (configured relay) | WebSocket or Direct Sockets | | driad | AMT via DRIAD discovery | HTTP access | | moq | MOQ WebTransport fallback | WebTransport |

License

Apache-2.0