Transport: the endpoint
A transport is something a service owns that can serve traffic. Each transport has:- an id, chosen by the service and unique within that service;
- a type, one of
static,http,socket.io, orproxy; and - type-specific configuration — for example, a
statictransport names the file or directory it serves, and aproxytransport names the upstream it forwards to.
Route: the binding
A route connects a URL pattern or a Socket.IO namespace to one transport, identified by the transport’s id. A route has:- an id, chosen by the service and unique within that service;
- the id of the transport it binds to; and
- exactly one of an HTTP declaration (
method,pattern,access) or a Socket.IO declaration (namespace,events,access,event_access).
static, http, or proxy transport — whichever
one should handle requests at that pattern. A Socket.IO route can only bind to
a socket.io transport. The access policy lives on the route, not the
transport, so the same transport type is configured identically regardless of
who can reach it; what changes per route is who can reach it and at what
URL or namespace.
Why they’re separate
Splitting the endpoint from the binding lets you:- expose the same transport at more than one route — for example, one static file source reachable at two different URL prefixes;
- change which paths point at a feature without recreating the underlying
connection, which matters most for a
proxytransport, where the upstream connection is comparatively expensive to set up; and - reason about ownership and cleanup independently: transports and routes are two registries, and the Kernel is the only thing allowed to coordinate between them.
Registering and removing resources
Awasm or grpc service can register and unregister transports and routes
at any point while it is running, not only at startup — see
Protocol for where this fits in the service lifecycle. A
static service instead declares its transports and routes once, up front,
in its package manifest; see Static services.
A few rules apply consistently:
- A transport cannot be removed while a route still references it. Remove the route first.
- When a batch of routes is registered together, successful items stay
registered even if others in the same batch fail; a failure marks the
service
degradedrather than rejecting the whole batch. - When a service session ends — the process exits, the WASM instance is unloaded, or the service is stopped through the management API — the Kernel removes all of that service’s routes and then its transports, so a dead service session can never leave a reachable but unowned binding.
Conflicts
Routes from different services share the same URL space, so the Kernel rejects a conflicting registration rather than silently overwriting one service’s route with another’s:- The same path cannot be owned by two different services, even for different HTTP methods.
- A route with no method (matching every method) conflicts with every method-specific route at the same path.
- A route backed by a
statictransport and a route backed by a non-static transport conflict at the same path, even if the methods would otherwise be compatible — a path is either served as static content or handled dynamically, not both.