admin

command
v0.0.0-...-0136c50 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Example: Admin API for runtime rule management

This example demonstrates the Admin API with a ReloadableFilter backed by a CSV blocklist. The proxy exposes REST endpoints at /api for listing, adding, and removing rules, checking status, and triggering reloads.

Endpoints:

GET  /api/status  - Proxy status and rule count
GET  /api/rules   - List all active rules
POST /api/rules   - Add a rule   {"type":"domain","pattern":"evil.com"}
DELETE /api/rules - Remove a rule {"type":"domain","pattern":"evil.com"}
POST /api/reload  - Reload rules from source

Try it:

curl http://localhost:8080/api/status
curl http://localhost:8080/api/rules
curl -X POST http://localhost:8080/api/rules -d '{"type":"domain","pattern":"ads.com","reason":"ads"}'
curl -X DELETE http://localhost:8080/api/rules -d '{"type":"domain","pattern":"ads.com"}'
curl -X POST http://localhost:8080/api/reload

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL