Crate embargoed

Source
Expand description

embargoed is a Rust library for Rocket, which implements a fairing that can be used to block all requests from Russian IP addresses and display a pro-Ukraine message instead.

This is a port of the Embargoed Gem (for Ruby/Rails) by rameerez.

check out their official list of ports for other frameworks.

to use simply attach the fairing to your Rocket build, like in this example (using Rocket version 0.5.0-rc.1):

#[macro_use] extern crate rocket;

#[get("/test")]
fn test() -> &'static str {
    "not embargoed"
}

#[launch]
fn rocket() -> _ {
    rocket::build()
        .attach(embargoed::fairing())
        .mount("/", routes![test])
}

Structs§

Embargoed

Functions§

fairing