Routing and request handling
How Dwara matches an incoming request to an upstream, and how it can shape the request and response along the way. These are the route-level building blocks you compose to expose your services: edge policies, transforms, caching, versioning, traffic splitting, protocol handling, discovery, and config scaffolding from an OpenAPI spec.
The core routing vocabulary (Listener, Route, Service, Upstream, Endpoint) is covered in Configuration; this section covers the optional route blocks that go on top.
In this section
- CORS - the edge block that answers browsers.
- Compression - shrink response bodies.
- Request limits and validation - cap request size and shape, with JSON Schema validation.
- Transforms - rewrite headers, query strings, and JSON bodies.
- Security headers - stamp security headers on responses.
- Response field masking - redact named fields per consumer group before anything else touches the body.
- Response caching - replay identical GET responses to cut upstream load and tail latency.
- API versioning - express versions with routing, match on
Accept, and deprecate a version with standard headers. - Traffic splitting and sticky sessions - weighted canary/blue-green splits plus a sticky-session cookie.
- gRPC proxying - native gRPC over h2 on the same listeners.
- WebSockets - managed tunnels with the one WebSocket origin gate.
- Dynamic upstream discovery - DNS-based live endpoint discovery for autoscaling upstreams.
- OpenAPI import and mock mode - scaffold a config from an OpenAPI spec and mock endpoints with no backend yet.
Runnable demo
Run these features against a live gateway: demos/01-routing/ in the repository. The test scripts cover the exact, prefix, and regex match types (test-01 through test-03), redirects, direct responses, mock responses, path rewrites, method allowlists, and host-header matches (test-04 through test-08 and test-10). The category README covers prerequisites and teardown.