返回顶部
b

boxed_curl沙盒安全请求

Run curl requests safely in a sandbox, supporting GET/POST/HTTP headers, with complete network isolation.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
84
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

boxed_curl

Boxed Curl 技能

在具有网络访问控制的 WASM 沙箱中安全地运行类似 curl 的 HTTP 请求。

触发方式

当用户说出以下内容时使用此技能:

  • - boxed curl、boxed curl
  • 沙箱版 curl、沙箱 curl、安全的 curl
  • 用 boxed-curl 请求、帮我 boxed-curl
  • 发一个安全的 HTTP 请求、安全的 GET/POST 请求

⚠️ 必需插件

此技能需要 openclaw-wasm-sandbox 插件版本 >= 0.2.0。

wasm-sandbox-download 工具在 0.2.0 版本中添加。如果插件未安装或版本较低:

bash
openclaw plugins install clawhub:openclaw-wasm-sandbox
openclaw plugins update openclaw-wasm-sandbox
openclaw gateway restart

验证版本:
bash
openclaw plugins inspect openclaw-wasm-sandbox

在输出中查找 Version: 0.2.0 或更高版本。

⚠️ 需要 WASM 文件

此技能需要先下载 WASM 组件文件。

如果本地不存在 WASM 文件,请使用 wasm-sandbox-download 工具下载:

步骤 0:下载 WASM 文件

javascript
wasm-sandbox-download({
url: https://raw.githubusercontent.com/guyoung/wasm-sandbox-openclaw-skills/main/boxed-curl/files/boxedcurlcomponent.wasm,
output: dir>/files/boxedcurl_component.wasm,
resume: false,
timeout: 60000
})

重要提示: 首次下载时设置 resume: false。下载目标为 github.com,支持断点续传。

工具:wasm-sandbox-run

在 WASM 文件可用后,使用 wasm-sandbox-run 工具执行 WASM 组件。

工作原理

  1. 1. 检查 WASM 文件 — 如果未找到,使用 wasm-sandbox-download 下载
  2. 用户提供类似 curl 的参数(URL 及可选选项)
  3. AI 提取 URL 和任何 curl 选项
  4. AI 根据目标主机确定 allowedOutboundHosts
  5. AI 使用参数和网络权限调用 wasm-sandbox-run

支持的功能

选项描述状态
-X, --request METHODHTTP 方法(GET、POST、PUT、DELETE 等)
-H, --header HEADER
添加请求头 | ✅ | | -d, --data DATA | 请求体数据 | ✅ | | -i, --include | 包含响应头 | ✅ | | -L, --location | 跟随重定向 | ✅ | | -v, --verbose | 详细输出 | ✅ | | -o, --output FILE | 输出到文件 | ⚠️ 不支持 |

使用模式

步骤 1:提取参数

解析用户输入:

  • - URL — 目标端点
  • curl 选项 — -X、-H、-d 等
  • allowedOutboundHosts — 如果用户明确提供

步骤 2:确定网络访问权限

如果用户未指定 allowedOutboundHosts,从 URL 推断:

URL 模式allowedOutboundHosts
https://api.github.com/https://api.github.com
https://httpbin.org/
https://httpbin.org |
| https://raw.githubusercontent.com/* | https://raw.githubusercontent.com |
| 任何 HTTPS URL | https://(从 URL 提取主机) |

步骤 3:调用 wasm-sandbox-run

javascript
wasm-sandbox-run({
wasmFile: dir>/files/boxedcurl_component.wasm,
allowedOutboundHosts: [https://],
args: [, ]
})

示例

GET 请求

用户说:从 https://httpbin.org/get 获取数据

javascript
wasm-sandbox-run({
wasmFile: dir>/files/boxedcurl_component.wasm,
allowedOutboundHosts: [https://httpbin.org],
args: [https://httpbin.org/get]
})

带 JSON 体的 POST 请求

用户说:curl -X POST https://httpbin.org/post -H Content-Type: application/json -d {name:value}

javascript
wasm-sandbox-run({
wasmFile: dir>/files/boxedcurl_component.wasm,
allowedOutboundHosts: [https://httpbin.org],
args: [-X, POST, -H, Content-Type:application/json, -d, {\name\:\value\}, https://httpbin.org/post]
})

带请求头的 GET 请求

用户说:使用自定义 Authorization 头获取数据

javascript
wasm-sandbox-run({
wasmFile: dir>/files/boxedcurl_component.wasm,
allowedOutboundHosts: [https://httpbin.org],
args: [-H, Authorization:Bearer token123, https://httpbin.org/get]
})

GitHub API 请求

用户说:获取 octocat 的 GitHub 用户信息

javascript
wasm-sandbox-run({
wasmFile: dir>/files/boxedcurl_component.wasm,
allowedOutboundHosts: [https://api.github.com],
args: [https://api.github.com/users/octocat]
})

带响应头的 GET 请求

用户说:使用 -i 标志获取响应头

javascript
wasm-sandbox-run({
wasmFile: dir>/files/boxedcurl_component.wasm,
allowedOutboundHosts: [https://httpbin.org],
args: [-i, https://httpbin.org/get]
})

重要说明

  • - 始终设置 allowedOutboundHosts — 沙箱默认阻止所有出站 HTTP
  • 如果缺少 WASM 文件,先下载 — 使用 wasm-sandbox-download 工具
  • 自动从 URL 提取主机 — 当用户未指定时
  • POST 请求使用 /post 端点 — /get 返回 405 Method Not Allowed
  • 参数顺序:curl 选项在前,URL 在后
  • -d 中的 JSON:正确转义引号(例如 {\key\:\value\})

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 boxed-curl-1775958371 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 boxed-curl-1775958371 技能

通过命令行安装

skillhub install boxed-curl-1775958371

下载

⬇ 下载 boxed_curl v1.0.0(免费)

文件大小: 2.6 KB | 发布时间: 2026-4-13 09:33

v1.0.0 最新 2026-4-13 09:33
boxed_curl v1.0.0

- Initial release providing sandboxed (WASM-based) execution of curl-like HTTP requests.
- Supports GET, POST, HTTP headers, and request bodies, with per-host network isolation via allowedOutboundHosts.
- Requires openclaw-wasm-sandbox plugin v0.2.0+ and a local boxed_curl_component.wasm file.
- Includes automatic extraction of curl arguments and outbound host restriction based on the target URL.
- Provides example usage patterns and options matrix; explicit documentation for setup and key usage tips.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部