@dev-anywhere/relay

中文文档
0.10.10发布于 2026/11/09MITTypeScriptES Module近 30 天下载 2878

Relay server for DEV Anywhere — bridges local AI CLI proxies to remote web clients via WebSocket.

原始使用文档
文档目录7 节
  1. Install
  2. Quick start
  3. Endpoints
  4. Environment variables
  5. TLS
  6. Using the embedded server programmatically
  7. License

@dev-anywhere/relay

Combined Relay and Web server for @dev-anywhere/proxy. It serves the DEV Anywhere Web/PWA client and bridges local AI CLI proxies to remote clients over WebSocket.

Install

npm install -g @dev-anywhere/relay

This installs the dev-anywhere-relay command globally.

Requires Node.js >= 22.22.2.

Quick start

# Minimal, plaintext WS on port 3100:
PORT=3100 dev-anywhere-relay

# With auth tokens (recommended for any public relay):
RELAY_PROXY_TOKEN="$(openssl rand -hex 24)" \
RELAY_CLIENT_TOKEN="$(openssl rand -hex 24)" \
PORT=3100 dev-anywhere-relay

Open http://localhost:3100/ to load the bundled Web client.

Endpoints

PathPurpose
/Bundled Web/PWA client and SPA routes
/healthHTTP GET — health probe
/statusHTTP GET — proxy/client counts
/api/*HTTP API, remote files, and uploads
/proxyWS — proxy daemon connection
/clientWS — Web/PWA client connection
/voice/*WS — voice recognition and speech synthesis

Environment variables

VariableDefaultNotes
PORT3100HTTP + WSS listen port
DATA_DIR~/.dev-anywhere/relay-dataPersistent state. Set to empty string to disable.
HEARTBEAT_INTERVAL30000 (ms)WS ping cadence
RELAY_PROXY_TOKENunset (open /proxy endpoint)When set, /proxy rejects connections without it
RELAY_CLIENT_TOKENunset (open /client endpoint)When set, /client rejects connections without it
LOG_LEVELinfopino log level

Production warning: always set both RELAY_PROXY_TOKEN and RELAY_CLIENT_TOKEN. Without a client token, anyone who can reach the relay can connect to /client, list proxies, and attempt to bind to a proxy.

For the bundled web client, open the app URL, then paste RELAY_CLIENT_TOKEN in Settings -> Relay Token. The token is stored in browser-local storage and appended to /client WebSocket connections.

TLS

This package serves the complete application over plain HTTP + WS. For production, put it behind nginx / Caddy / Cloudflare for TLS termination. To install or upgrade the turnkey setup (one Docker container + nginx + certbot), run this as root on a Linux VPS, replacing the public domain/IP:

curl -fsSL https://raw.githubusercontent.com/lichenxicatapple-blip/dev-anywhere/main/install.sh | bash -s -- dev-anywhere.example.com

The installer pulls the latest published image and preserves existing tokens. For deployment from macOS, Linux, or native Windows PowerShell, see the VPS deployment guide. No repository clone is needed.

Using the embedded server programmatically

import { createRelayServer } from "@dev-anywhere/relay/server";
import pino from "pino";

const relay = createRelayServer({
  port: 3100,
  logger: pino(),
  proxyToken: process.env.RELAY_PROXY_TOKEN,
  clientToken: process.env.RELAY_CLIENT_TOKEN,
});

License

MIT © catli

版本与发布记录

@dev-anywhere/relay 共发布 216 个版本,首次发布于 2026/05/08;过去 12 个月发布了 216 个版本。

版本发布日期距今
0.10.10latest2026/11/092 天前
0.10.92026/11/083 天前
0.10.82026/11/038 天前
0.10.72026/11/039 天前
0.10.62026/10/3013 天前
0.10.52026/10/2913 天前

关于 @dev-anywhere/relay 的常见问题

@dev-anywhere/relay 是什么?

Relay server for DEV Anywhere — bridges local AI CLI proxies to remote web clients via WebSocket.

如何安装 @dev-anywhere/relay?

在项目目录运行 npm install @dev-anywhere/relay,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 dev-anywhere-relay,可以用 npx dev-anywhere-relay 直接运行。

@dev-anywhere/relay 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dev-anywhere/relay 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@dev-anywhere/relay 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.22.2。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@dev-anywhere/relay 可以商用吗?

@dev-anywhere/relay 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@dev-anywhere/relay 的下载量有多少?

根据 npm 官方下载统计,@dev-anywhere/relay 在 2026/10/12 – 2026/11/10 这 30 天内被下载 2,878 次,日均约 96 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dev-anywhere/relay 还在维护吗?

最新版本 0.10.10 发布于 2026/11/09(2 天前);至今共发布 216 个版本,其中过去 12 个月发布了 216 个;首次发布于 2026/05/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。