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

openclaw-httpbridge

v0.2.0

Published

OpenClaw HTTP bridge channel (HTTP inbound + callback outbound)

Readme

OpenClaw HTTP Bridge

English | 简体中文

OpenClaw 的 HTTP 入站 + 回调出站通道插件。通过 HTTP 向 OpenClaw 发送消息,并通过 callbackUrl 接收所有回复。

功能

  • HTTP webhook 入站 (/httpbridge/inbound)
  • 按会话路由回调
  • 基于 token 的入站鉴权
  • 可选回调主机白名单
  • 兼容 OpenClaw 通道路由/会话行为
  • 支持 openclaw channels add 和引导式配置

安装

npm(推荐)

openclaw plugins install openclaw-httpbridge
openclaw plugins enable openclaw-httpbridge

本地安装(git clone)

git clone https://github.com/openclaw/openclaw-httpbridge.git
openclaw plugins install /path/to/openclaw-httpbridge
openclaw plugins enable openclaw-httpbridge

工作流(如何运行)

sequenceDiagram
  participant Client
  participant Bridge as HTTP Bridge Plugin
  participant OpenClaw as OpenClaw Agent
  participant Callback as Your Service

  Client->>Bridge: POST /httpbridge/inbound
  Note over Client,Bridge: {conversationId, text, callbackUrl}
  Bridge->>Bridge: Validate token
  Bridge->>Bridge: Store callbackUrl by conversationId
  Bridge->>OpenClaw: Build inbound context + dispatch
  OpenClaw-->>Bridge: Reply payload(s)
  Bridge->>Callback: POST callbackUrl (each reply)

配置

方式 A:openclaw channels add(CLI 推荐)

openclaw channels add --channel httpbridge \
  --token shared-secret \
  --webhook-path /httpbridge/inbound \
  --url http://127.0.0.1:9011/callback

方式 B:引导式配置

openclaw channels add --channel httpbridge

引导会提示:

  • token
  • webhookPath
  • callbackDefault
  • allowCallbackHosts(可选)

方式 C:手动配置(JSON)

{
  "channels": {
    "httpbridge": {
      "enabled": true,
      "token": "shared-secret",
      "webhookPath": "/httpbridge/inbound",
      "callbackDefault": "http://127.0.0.1:9011/callback",
      "allowCallbackHosts": ["127.0.0.1"],
      "callbackTtlMinutes": 1440,
      "maxCallbackEntries": 10000
    }
  }
}

配置字段说明

| 字段 | 类型 | 必填 | 说明 | | --- | --- | --- | --- | | enabled | boolean | 否 | 启用/禁用通道。 | | token | string | 是 | 入站鉴权 token。请求需包含 Authorization: Bearer <token>x-openclaw-token。 | | webhookPath | string | 否 | 入站 webhook 路径。默认:/httpbridge/inbound。 | | callbackDefault | string (URL) | 是 | 当入站 payload 未提供 callbackUrl 时使用的默认回调地址。 | | allowCallbackHosts | string[] | 否 | 回调主机白名单;设置后,其他主机的回调将被拒绝。 | | callbackTtlMinutes | number | 否 | conversationId -> callbackUrl 缓存 TTL(默认 1440 分钟)。 | | maxCallbackEntries | number | 否 | 缓存回调条目上限(默认 10000)。 | | defaultAccount | string | 否 | 多账号配置时的默认账号 ID。 | | accounts | object | 否 | 按账号覆盖配置(字段同上)。 |

使用

入站请求

curl -X POST http://127.0.0.1:18789/httpbridge/inbound \
  -H 'Authorization: Bearer shared-secret' \
  -H 'Content-Type: application/json' \
  -d '{"conversationId":"demo-123","text":"Hello OpenClaw","callbackUrl":"http://127.0.0.1:9011/callback"}'

入站 payload

{
  "conversationId": "demo-123",
  "text": "Hello OpenClaw",
  "callbackUrl": "http://127.0.0.1:9011/callback",
  "senderId": "user-42",
  "senderName": "Alice",
  "metadata": {"source": "demo"}
}

回调 payload

{
  "conversationId": "demo-123",
  "messageId": "httpbridge-1730000000000",
  "text": "OpenClaw reply text",
  "mediaUrls": [],
  "sessionKey": "httpbridge:demo-123",
  "agentId": "main",
  "timestamp": 1730000000000
}

安全建议

  • 将 webhook 放在受信网络或代理后面。
  • 使用强 token
  • 尽量限制 allowCallbackHosts

开发

  • 代码入口:index.ts
  • 通道实现:src/channel.ts
  • Webhook 处理:src/monitor.ts
  • 引导式配置适配:src/onboarding.ts

License

MIT