@ai-ecoverse/wasix-websocat

中文文档
4.0.0-alpha3-8发布于 2026/10/21MIT OR Apache-2.0零依赖构建来源已验证近 30 天下载 2987

websocat, a WebSocket client and server like netcat for ws:// URLs, for SLICC.

原始使用文档
文档目录3 节
  1. Networking
  2. Limits on WASIX
  3. Exit codes and logs

@ai-ecoverse/wasix-websocat

websocat 4.0.0-alpha3, the WebSocket client and server ("netcat for ws://"), built for slicc's kernel as a WASIX program. This is an upstream alpha: websocat v4 has no stable release yet. It's upstream's source with two WASIX patches (subprocesses fail cleanly; see below) and a patch for exit codes and logs (see Exit codes and logs). The build also patches crate wiring and the WASIX fork of mio; see the recipe.

pnpm add -g @ai-ecoverse/wasix-websocat
websocat -s 8080 mirror:                 # an echo server on the kernel loopback
echo hi | websocat ws://127.0.0.1:8080/  # hi
websocat -b ws://127.0.0.1:8080/ < file  # binary messages

Needs slicc-kernel 1.95.0 or later (WASIX epoll and eventfd, slicc-kernel#674).

Networking

websocat v4 opens its own TCP connections and does its own TLS, with rustls and the bundled Mozilla roots (webpki-roots), so wss:// needs no CA setup. It has no HTTP or SOCKS proxy support, so it never goes through the kernel's https_proxy.

  • Kernel loopback (127.0.0.1, localhost) always works.
  • Other hosts (ws://example.com/, wss://…) need an exit that gives programs raw TCP: in seven, a linked slicc CLI or a Tailscale exit node (the kernel's uplink). Without one:
    • a name fails with No such file or directory (os error 44);
    • an address fails with Network unreachable.
  • No TLS server: websocat v4 can't serve wss://.
  • What the cert covers through an uplink: ws:// echo, and wss:// with -k. That's the TLS handshake and framing against a throwaway CA. Chain verification uses the embedded webpki roots, and is covered by slicc-bios end to end.

Limits on WASIX

  • No subprocesses (homescoop#689, #709): websocat's process support doesn't work on this target. exec:, cmd: and sh-c: are refused at startup (exec:, cmd: and sh-c: are not supported on WASIX), and so is --exec-after-listen. In -x scenario scripts, subprocess_new, subprocess_new_osstr and system fail with subprocesses are not supported on WASIX. Every case exits non-zero, with no panic.

Exit codes and logs

Since 4.0.0-alpha3-7, a failure that upstream v4 only logged exits non-zero, and every log line goes to stderr, so websocat … > out and websocat … | jq carry only data (homescoop#868). RUST_LOG sets the level (RUST_LOG=debug, RUST_LOG=off; default INFO, homescoop#1421):

ExitWhen
14a connect is refused or fails (upstream's)
15a listener can't bind its address, for example the port is in use (homescoop#696; upstream exits 0)
16readfile:, writefile: or appendfile: can't open its file (homescoop#1023; upstream exits 0)
20, 21a hostname has no address, or its lookup fails (upstream's)

websocat 4 is upstream's current line but still a pre-release: options and specifiers differ from websocat 1.x (see websocat --help; for example, there's no -1).

版本与发布记录

@ai-ecoverse/wasix-websocat 共发布 10 个版本,首次发布于 2026/10/16;过去 12 个月发布了 10 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
4.0.0-alpha3-8latest2026/10/2117 天前
4.0.0-alpha3-72026/10/2018 天前
4.0.0-alpha3-62026/10/2018 天前
4.0.0-alpha3-52026/10/1721 天前
4.0.0-alpha3-42026/10/1721 天前
4.0.0-alpha3-32026/10/1622 天前

关于 @ai-ecoverse/wasix-websocat 的常见问题

@ai-ecoverse/wasix-websocat 是什么?

websocat, a WebSocket client and server like netcat for ws:// URLs, for SLICC.

如何安装 @ai-ecoverse/wasix-websocat?

在项目目录运行 npm install @ai-ecoverse/wasix-websocat,或使用 pnpm add / yarn add / bun add。

@ai-ecoverse/wasix-websocat 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ai-ecoverse__wasix-websocat 是否存在。

@ai-ecoverse/wasix-websocat 可以商用吗?

@ai-ecoverse/wasix-websocat 使用 MIT OR Apache-2.0 许可。可在 MIT、Apache-2.0 中任选其一遵守。选择 MIT 时,宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ai-ecoverse/wasix-websocat 的下载量有多少?

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

@ai-ecoverse/wasix-websocat 还在维护吗?

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