implement cache/clean api

This commit is contained in:
postscriptum 2026-03-23 08:47:47 +02:00
parent 0603fdf4a6
commit 461f838cc0
4 changed files with 35 additions and 3 deletions

View file

@ -26,8 +26,9 @@ RUST_LOG=trace cargo run -- --allow=http://localhost/allow.txt \
```
* set `socks5://127.0.0.1:1080` proxy in your application
* open http://127.0.0.1:8010 in browser for stats:
* `/api/allow/domain.com` - add rule to the current session (and `--cache` if defined)
* `/api/block/domain.com` - delete rule from the current session (and `--cache` if defined)
* `/api/allow/{domain.com}` - add rule to the current session (and `--cache` if defined)
* `/api/block/{domain.com}` - delete rule from the current session (and `--cache` if defined)
* `/api/cache/clean` - clean `--cache` file (returns deleted rules or `null` if not enabled)
### Allow list example