radius-server
A lightweight, async RADIUS server library written in Rust. Built for performance, extensibility, and compatibility with FreeRADIUS-style dictionaries.
✨ Features
- ✅ Parses and builds RADIUS packets
- 📚 Loads FreeRADIUS-style dictionaries
- 🔒 Supports shared secret verification
- ⚙️ Custom packet handlers via closures
- 🧩 Vendor-Specific Attribute (VSA) support
- 🚀 Async and multithreaded using
tokio
📦 Usage
= "0.2.0"
```rust
sync::Arc;
{
Dictionary,
RadiusAttribute,
};
#[tokio::main]
-> Result<(), Box<dyn std::error::Error>> {
= Arc::new(Dictionary::load_embedded()?);
= "test123";
dict, secret, move |packet| async move {
"🔍 Incoming ID {} from {:?}", packet.identifier, packet.username());
= packet.username() {
== "ec:30:b3:6d:24:6a" {
session_timeout(3600),
reply_message("Welcome, admin."),
]))
} else {
}
} else {
}
}).await
}