Cap'n Web
lastmod 2025-09-25created 2025-09-251 edits
Cap'n Web, a new RPC system for browsers and web servers
About
- Cap'n Web is a new RPC protocol implemented in TypeScript, optimized for the web and running on various JavaScript runtimes
- Provides JSON-based serialization and a human-readable data format, with no schemas or tedious boilerplate
- Its object-capability model enables bidirectional calls, passing function and object references, promise pipelining, and implementing security patterns
- Supports various network environments such as WebSocket, HTTP, and postMessage, and is lightweight open source under 10kB
- Not only solves the waterfall problem much like GraphQL, but also enables natural RPC modeling that feels like an ordinary JavaScript API