A lightweight static HTTP server based on WebAssembly sandbox, with support for HTTP Basic authentication and HTTP proxy/reverse proxy.
Use this skill when the user describes (触发场景):
>=0.4.0js
wasm-sandbox-download({
url: "https://raw.githubusercontent.com/guyoung/wasm-sandbox-openclaw-skills/main/boxed-http-server/files/boxed_http_server_component.wasm",
dest: "~/.openclaw/skills/boxed-http-server/files/boxed_http_server_component.wasm"
})
Or via command line:
bash
curl -L -o ~/.openclaw/skills/boxed-http-server/files/boxed_http_server_component.wasm \
"https://raw.githubusercontent.com/guyoung/wasm-sandbox-openclaw-skills/main/boxed-http-server/files/boxed_http_server_component.wasm"
js
wasm-sandbox-serve({
wasmFile: "~/.openclaw/skills/boxed-http-server/files/boxed_http_server_component.wasm",
workDir: ["~/.openclaw/skills/boxed-http-server/files"]
})
Or via command line:
bash
openclaw wasm-sandbox serve ~/.openclaw/skills/boxed-http-server/files/boxed_http_server_component.wasm \
-i 192.168.1.100 -p 8080 --work-dir /path/to/website
Protect your website with username/password authentication:
js
wasm-sandbox-serve({
wasmFile: "~/.openclaw/skills/boxed-http-server/files/boxed_http_server_component.wasm",
workDir: ["~/.openclaw/skills/boxed-http-server/files"],
args: ["--config-var", "username=admin", "--config-var", "password=admin"]
})
Proxy external APIs through the server. Requires allowedOutboundHosts for the target domain:
js
wasm-sandbox-serve({
wasmFile: "~/.openclaw/skills/boxed-http-server/files/boxed_http_server_component.wasm",
workDir: ["~/.openclaw/skills/boxed-http-server/files"],
allowedOutboundHosts: ["https://httpbin.org"],
args: ["--config-var", "proxy=\"[{\\\"path\\\": \\\"/httpbin\\\",\\\"target\\\" :\\\"https://httpbin.org\\\",\\\"headers\\\": {\\\"Authorization\\\": \\\"Bearer abcd1234\\\"}}]\""]
})
Serve a static website while proxying external APIs to avoid CORS issues:
js
wasm-sandbox-serve({
wasmFile: "~/.openclaw/skills/boxed-http-server/files/boxed_http_server_component.wasm",
workDir: ["/home/user/website"],
allowedOutboundHosts: ["https://api.weather.com", "https://wttr.in"],
args: ["--config-var", "proxy=\"[{\\\"path\\\": \\\"/weather\\\",\\\"target\\\": \\\"https://wttr.in\\\"}]\""]
})
Then update your frontend to call /weather instead of the external API directly.
ParameterTypeRequiredDescriptionwasmFilestringYesPath to the wasm component fileworkDirstring[]YesWebsite root directories (served as static files)allowedOutboundHostsstring[]NoAllowed external domains for proxy modeargsstring[]NoCommand-line args for auth and proxy config
OptionShortDescription--ip <ip>``-iSocket IP to bind to--port <port>``-pSocket port to bind to (0-65535)--work-dir <dir>Website root directory--config-var <var>WASI config variables--allowed-outbound-hosts <hosts>Allowed external domains (proxy mode)
--config-var username=<username> - Set Basic auth username--config-var password=<password> - Set Basic auth password--config-var proxy=<JSON> - Set proxy rules in JSON formatjson
[
{
"path": "/httpbin",
"target": "https://httpbin.org",
"headers": {
"Authorization": "Bearer abcd1234"
}
}
]
FieldTypeDescriptionpathstringProxy path prefix (requests matching this prefix will be proxied)targetstringTarget full URLheadersobjectOptional custom headers to add to the proxied request
Boxed HTTP Server runs inside WebAssembly sandbox with capability-based security:
text
User Request
↓
OpenClaw Gateway
↓
Wasm Sandbox Plugin
↓
boxed_http_server_component.wasm
↓
├── Static File Handler (workDir)
├── Basic Auth Handler (args: username/password)
└── Proxy Handler (args: proxy config)
↓
Response to Client
Deploy a static website at http://192.168.158.134:8080:
bash
# 1. Download wasm file (if not exists)
curl -L -o ~/.openclaw/skills/boxed-http-server/files/boxed_http_server_component.wasm \
"https://raw.githubusercontent.com/guyoung/wasm-sandbox-openclaw-skills/main/boxed-http-server/files/boxed_http_server_component.wasm"
# 2. Start server
openclaw wasm-sandbox serve \
~/.openclaw/skills/boxed-http-server/files/boxed_http_server_component.wasm \
-i 192.168.158.134 \
-p 8080 \
--work-dir /home/user/website
IssueSolution"wasm file not found"Run the download step first"Connection refused"Check IP and port, ensure firewall allows access"CORS errors in frontend"Use proxy mode to route external APIs through the server"Authentication not working"Ensure username and password are set in args"Proxy returns 403"Add target domain to allowedOutboundHosts