Quick Start
Get a reverse proxy running in 60 seconds.
1. Start Your Application
Section titled “1. Start Your Application”You need an application running on a local port. For this example, we’ll use a simple Python server:
echo "Hello from my app!" > index.htmlpython3 -m http.server 8080 &2. Create a Dwaarfile
Section titled “2. Create a Dwaarfile”cat > Dwaarfile <<EOFexample.com { proxy localhost:8080}EOFReplace example.com with your actual domain. The domain’s DNS must point to this server’s IP.
3. Run Dwaar
Section titled “3. Run Dwaar”sudo dwaar
sudois needed to bind to ports 80 and 443. See running without root for alternatives.
That’s it. Dwaar will:
- Read the Dwaarfile
- Request a TLS certificate from Let’s Encrypt for
example.com - Start listening on ports 80 (redirect to HTTPS) and 443 (HTTPS)
- Proxy all traffic to
localhost:8080
Visit https://example.com — you’ll see your application served over HTTPS.
Local Development (No Domain)
Section titled “Local Development (No Domain)”For local development without a real domain:
cat > Dwaarfile <<EOFlocalhost { proxy localhost:8080 tls off}EOF
dwaarVisit http://localhost — traffic is proxied without TLS.
Multiple Domains
Section titled “Multiple Domains”cat > Dwaarfile <<EOFapi.example.com { proxy localhost:3000 rate_limit 100/s}
blog.example.com { proxy localhost:4000 analytics on}
admin.example.com { proxy localhost:5000}EOFEach domain gets its own TLS certificate, routes to a different upstream, and can have independent features enabled.
Enable Analytics
Section titled “Enable Analytics”Add analytics on to any domain block:
example.com { proxy localhost:8080 analytics on}Dwaar will inject a lightweight JavaScript snippet into HTML responses. Analytics data is available via the Admin API:
curl http://localhost:9876/analytics/example.comWhat’s Next
Section titled “What’s Next”- Dwaarfile Reference — all configuration options
- Automatic HTTPS — how TLS works
- First-Party Analytics — analytics in depth
- Admin API — runtime management