Files
7eb2be245b docs: add zip + fiber overview pages, correct transports overview (#3)
Add compact zip and fiber overview pages that deep-link to the developer portal for the full guides, and wire them into the docs nav. Replace the transports page's non-existent options API with an accurate summary (the ZAP-inside/edge-only law + the three surfaces).

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-10 14:20:03 -07:00

45 lines
2.7 KiB
Plaintext

---
title: Transports
description: ZAP is the native wire between services; HTTP and WebSocket appear only at the edge.
---
# Transports
ZAP is the wire, not a library bolted onto TCP. The transport layer answers one question — *how do two peers exchange ZAP frames* — the same way for native RPC, an HTTP bridge, and a full [zip](/docs/zip) application, because they all sit on the same wire.
## The law: ZAP inside, HTTP/WS only at the edge
> **Internal service ↔ service traffic is ZAP. HTTPS and WebSocket appear only at the edge — the single point where the system talks to something it does not control.**
Inside a cluster or a mesh, both peers are trusted and speak ZAP: zero-copy framing, capability-based authority, and a post-quantum handshake at the transport layer instead of a per-call bearer token. At the edge — a browser, a partner API — you terminate ZAP and translate to the classical protocol the outside world expects.
```
Outside world ──HTTPS / WSS──▶ [ edge: the only translator ] ──ZAP──▶ services ──ZAP──▶ services
```
## Three ways onto the wire
| Surface | Package | Use it when |
|---|---|---|
| **Native ZAP RPC** | [`zap-proto/go`](https://github.com/zap-proto/go) | Greenfield service ↔ service — define `.zap` interfaces, generate code, use ZAP's capability model. |
| **HTTP over ZAP** | [`zap-proto/http`](https://github.com/zap-proto/http) | You have `net/http` handlers or `http.Client` code and want the ZAP wire underneath, unchanged (X-Wing hybrid PQ handshake). |
| **zip** | [`zap-proto/zip`](https://github.com/zap-proto/zip) | A full web framework — Sinatra-style routes, typed handlers, OpenAPI + MCP — ZAP primary and HTTP extra from one `Listen`. |
Under ZAP the network is a value — TCP, Unix socket, TLS, and QUIC — reached through `transport.Listen(network, addr, dispatch)` and `transport.Dial(network, addr)` in the Go runtime, or the client and server that [codegen](https://zap-proto.dev/docs/codegen) emits from your schema.
## In the browser and at the edge
Browser → server is **TLS 1.3** (recent Chrome and Safari ship the `X25519MLKEM768` KEM), running over `wss://`. The X-Wing handshake terminates at the server, so end-to-end PQ ZAP from a browser needs a server-side terminator:
```
Browser ──(wss:// + TLS 1.3 hybrid KEM)──▶ Edge Worker ──(ZAP over X-Wing)──▶ Origin
```
The Edge Worker (any V8 isolate runtime) is that terminator — the browser sees `fetch`, the Worker holds the persistent ZAP connection upstream.
## Learn more
The full transport reference lives on the developer portal:
**[zap-proto.dev/docs/transports →](https://zap-proto.dev/docs/transports)**