Skip to content

First configuration

The tracked examples/first-config.yml runs a loopback-only HTTP listener. It needs no certificates, upstream service, or firewall changes.

examples/first-config.yml
- address: 127.0.0.1:8080
transport: tcp
target:
allowlist: 127.0.0.1/32
default_http_action:
type: serve-message
status_code: 200
content: "Hello from tobaru!\n"
response_headers:
Content-Type: text/plain

From the repository root, validate it before starting:

Terminal window
tobaru --dry-run examples/first-config.yml
tobaru examples/first-config.yml

In another terminal:

Terminal window
curl http://127.0.0.1:8080/

The response is Hello from tobaru!. Stop the foreground process with Ctrl-C. --dry-run validates configuration and referenced TLS files without binding listeners. It cannot prove the port is available or a backend is reachable.

For a service already listening on port 9000:

Terminal window
tobaru 'tcp://127.0.0.1:8080?target=127.0.0.1:9000'

The URL shortcut allows all source IPs and has no resource cap by default. Keep the loopback bind for local access; use YAML for allowlists and explicit limits before exposing a service.

Continue with examples for TLS and hostname routing.