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

@husky-di/remote-websocket

v1.0.0

Published

Downloads

104

Readme

@husky-di/remote-websocket

Binary WebSocket Transport Adapters for @husky-di/remote. The package root works in browsers; Node clients and listeners use @husky-di/remote-websocket/node. Requires Node >=23.6 for Node use.

import { createRpcConnector } from '@husky-di/remote';
import { createWebSocketConnectorAdapter } from '@husky-di/remote-websocket';

const connector = createRpcConnector();
await connector.connect({
  adapter: createWebSocketConnectorAdapter({ url: 'wss://example.com/rpc' }),
});
// Expose/resolve service descriptors through connector.peer.
await connector.close();
import { createRpcAcceptor } from '@husky-di/remote';
import { createNodeWebSocketAcceptorAdapter } from '@husky-di/remote-websocket/node';

const acceptor = createRpcAcceptor();
await acceptor.listen(
  createNodeWebSocketAcceptorAdapter({ port: 9000, host: '127.0.0.1', path: '/rpc' }),
);
await acceptor.close();

A Node client uses createNodeWebSocketConnectorAdapter({ url }) from ./node. To borrow an HTTP(S) server, replace port with server. The Adapter never closes a borrowed server. Factories are cold and each Adapter starts once. Compose a fresh factory per attempt with Remote's createRpcReconnectionConnector for recovery.

Messages default to a 1 MiB maximum. Each direction has a 16-message / 4 MiB queue budget, configurable with maxMessageBytes, maxQueuedMessages, and maxQueuedBytes. An accepted listener defaults to 64 Connections and rejects excess upgrades while keeping healthy Connections available. Node ws.maxPayload enforces the complete-message limit before adapter copying, including fragmented or decompressed messages. Compression defaults off. Browser APIs cannot reject payloads before browser allocation; enforce earlier limits at the server/proxy. Outbound limits account for application bytes; native framing can add up to 14 bytes per queued message (14 * maxQueuedMessages) beyond that budget. Sends settle at local admission into a bounded native queue, with an owned byte snapshot, and do not prove delivery or execution.

Production recovery requires authenticated wss: with certificate validation, anti-replay protection, and RPC handshake data excluded from TLS 0-RTT. Authenticate initiators and check allowed origins before RPC admission, such as at an authenticated reverse proxy; apply per-principal quotas and request limits there. An HTTP server option or server-authenticated TLS does not itself authenticate an initiating application. Plain ws: examples are for local development.

See the normative specification for options and lifecycle contracts and the workspace Remote Lab example for a runnable browser/server demonstration. Development checks:

pnpm --filter @husky-di/remote-websocket test
pnpm check:code-standard