Create Zeroserve eBPF request-processing scripts in C for `.zeroserve/scripts` using the Zeroserve SDK (`zeroserve.h`). Use when you need to implement request inspection, header/query parsing, metadata templating, custom responses, or reverse-proxy behavior in a script.
Zeroserve is a high-performance, scriptable HTTP server that uses io_uring and eBPF. It
serves a static website from a tarball, and optionally runs eBPF request scripts.
It supports HTTP, HTTPS, hot reload, a small templating pass for text responses, and
an opt-in reverse proxy from scripts.
This skill creates a Zeroserve request script in C from requirements, using the SDK helpers
and eBPF constraints. Output is a single .c file ready to place under .zeroserve/scripts/.
It includes JSON helper usage for parsing structured inputs from headers or params.
Serve a prebuilt tarball:
zeroserve --addr 0.0.0.0:8080 site.tar
Package a directory into a tarball and serve it:
# Create a tarball from the current directory
zeroserve --pack . > site.tar
# Serve it
zeroserve --addr 0.0.0.0:8080 site.tar
Packaging a site: Zeroserve expects a tarball whose root corresponds to the site root.
Use --pack to build one from a directory:
zeroserve --pack ./public > site.tar
Packaging notes:
.zeroserve/scripts/..c file in .zeroserve/scripts/ is compiled to an .o eBPF object.
The resulting .o is included in the tarball and the .c is omitted..c and .o share the same name, the .o is skipped in favor of recompiling.clang and llc on your PATH.If you want the SDK header without packing:
zeroserve --dump-sdk > zeroserve.h
zs_respond or zs_reverse_proxy.assets/script_template.c for a new script.ZS_ENTRY section if editing an existing script.zs_req_* helpers into fixed buffers; clamp lengths before use.ZS_STR("literal") for helper calls needing (ptr, len) for string literals.zs_json_parse/zs_json_get/zs_json_array_get and
zs_json_read_*, then free handles with zs_object_free (handle table is limited).zs_req_body_json() which returns a handle
(-1 on empty body, body > 256KB, or invalid JSON). The body is read lazily and cached.zs_json_new_object/zs_json_new_array and modify
with zs_json_set, zs_json_array_push, zs_json_set_string, zs_json_set_i64, etc.zs_json_respond(status, handle) which auto-sets Content-Type.zs_load_static_json(path, path_len)
and treat the returned handle like any other JSON handle.zs_load_file_metadata(path, path_len)
and access size, etag, and mtime.zs.response.header.<name>.zs_rate_limit(key, key_len, per_second, per_minute, per_hour);
it returns a result code indicating allowed or which limit was exceeded.zs_respond, zs_json_respond, or zs_reverse_proxy to stop later scripts..c file and note it should live under .zeroserve/scripts/.zeroserve --pack compiles .c to .o automatically.zeroserve --dump-sdk to inspect the full API.references/sdk_api.md for the SDK helper list and notes.references/scripting_behavior.md for execution order, short-circuit rules, and packaging.references/examples.md for common patterns (logging, health response, reverse proxy, templating).assets/script_template.c for a starter skeleton.下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer