Home / Companies / Cloudflare / Blog / Post Details
Content Deep Dive

Cap'n Web: a new RPC system for browsers and web servers

Blog post from Cloudflare

Post Details
Company
Date Published
Author
Kenton Varda and Steve Faulkner
Word Count
2,831
Company Posts That Month
50
Language
English
Hacker News Points
-
Post removed?
No
Summary

Cap'n Web is a new RPC protocol written in TypeScript, designed as a web-friendly counterpart to Cap'n Proto. It eliminates the need for schemas and boilerplate, using JSON for serialization and supporting HTTP, WebSocket, and postMessage for transport. Cap'n Web is lightweight, open source under the MIT license, and can be minified to under 10 kB. It enables bidirectional calling, passing functions and objects by reference, promise pipelining, and capability-based security patterns. This allows developers to design RPC interfaces similarly to JavaScript APIs while addressing network latency issues. Cap'n Web is compatible with TypeScript, enabling type-safe RPC API declarations. It offers an alternative to GraphQL by solving the "waterfall" problem in REST APIs without introducing new languages or ecosystems, allowing complex interactions to be modeled in JavaScript. Cap'n Web also introduces a novel way of handling arrays with a special `.map()` operation that enables server-side transformations without additional network round trips.

Trends Found in this Post
Trend Post Mentions Total Month Mentions Posts Companies MoM
Real-time 1 4,065 968 231 -6%
Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.