https://github.com/itsjunetime/tower-no-ai
A tower service to redirect all "AI" scraping bots
https://github.com/itsjunetime/tower-no-ai
Last synced: about 1 year ago
JSON representation
A tower service to redirect all "AI" scraping bots
- Host: GitHub
- URL: https://github.com/itsjunetime/tower-no-ai
- Owner: itsjunetime
- Created: 2024-06-29T20:01:54.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-01T06:00:50.000Z (over 1 year ago)
- Last Synced: 2025-03-28T23:34:29.484Z (over 1 year ago)
- Language: Rust
- Size: 8.79 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# `tower-no-ai`
A very simple crate to extend tower with the ability to redirect all AI-scraper bot User-Agent headers to a user-defined URL.
This can be done with something like the following (with axum):
```rust
use tower_no_ai::NoAiLayer;
use axum::routing::{get, Router};
let route = Router::new()
.route("/", get(hello_world))
// route them to a hetzner 10GB speed test file
.layer(NoAiLayer::new("https://fsn1-speed.hetzner.com/10GB.bin"));
```
As this is built on `tower`, it should work perfectly with all tower-based backends.
Contributions, bug reports, and suggestions are welcome.
Dual-Licensed MIT and Apache 2.0