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

myde-remote-connect

v0.0.5

Published

Secure remote connection module with PAKE pairing and Noise IK handshake

Readme

myde-remote-connect

远程连接模块,支持配对和自动连接。

功能特性

  • 端到端加密
  • 通过 PIN 码配对
  • 支持凭证保存和重连
  • 多种适配器: 支持 PeerJS (WebRTC)、本地回环等
  • 纯 ESM 模块(浏览器、nodejs、electron兼容)

快速开始

不受信任信道(如网络)- PAKE 配对

import { SConnect } from "myde-remote-connect/sconnect";
import { UntrustedLoopbackAdapterManager } from "myde-remote-connect/loopback_adapter";

// 创建适配器对
const [adapterA, adapterB] = UntrustedLoopbackAdapterManager.createPair();

// 创建通道实例
const channelA = new SConnect(adapterA, { handshakeTimeout: 10000 });
const channelB = new SConnect(adapterB, { handshakeTimeout: 10000 });

// 初始化,id需要手动创建,建议使用crypto.randomUUID()
await channelA.init("device-a");
await channelB.init("device-b");

// ===== 接收方 B:监听配对请求 =====
channelB.on("pairRequest", async (request) => {
    console.log(`${request.remoteDeviceId} 请求配对`);

    // 用户输入对方显示的 PIN
    const pin = await getUserInput("请输入对方显示的 PIN:");

    // 接受配对
    request.inputOtherPin(pin);
    const credential = await request.waitForPairing();
    console.log("B 配对成功", credential);

    // 或者拒绝配对
    // request.reject();
});

// ===== 发起方 A:发起配对 =====
const pairing = await channelA.pairInit({
    myDeviceId: "device-a",
    remoteDeviceId: "device-b",
});

// 显示 PIN 给用户
console.log("请将此 PIN 告诉对方:", pairing.pin);

// 等待对方输入 PIN 完成配对
const credentialA = await pairing.waitForPairing();
console.log("A 配对成功", credentialA);

// 任何一方都可以输入pin

// 现在可以安全通信
await channelA.send("Secure message");

使用凭证重连

// A 有 B 的 Credential(之前配对获得的)
// 必须提供对方 id,Credential 里有
await channelA.init("device-a", "device-b");
await channelB.init("device-b", "device-a");
// ===== 发起方 A =====
const credentialOfB = loadCredential("device-b");
const result = await channelA.tryConnect(credentialOfB);
if (result.success) {
    console.log("连接成功");
}
// 如果 { success: false, reason: "NEEDS_PAIRING" } ,需要重新执行配对流程

// ===== 接收方 B =====
channelB.on("connectRequest", async (request) => {
    console.log(`${request.remoteDeviceId} 请求连接`);

    // 从本地存储加载 B 保存的关于 A 的 Credential
    const credentialOfA = loadCredential(request.remoteDeviceId);

    if (credentialOfA) {
        // 使用保存的 Credential 接受连接
        const result = await request.accept(credentialOfA);
        console.log("连接成功", result);
    } else {
        // 没有保存的凭证,拒绝
        request.reject();
    }
});

更多

AGENTS.md

许可证

AGPL-3.0-only