iron_vhosts 0.2.0

An Iron addon to allow requests to be routed based on the host.
docs.rs failed to build iron_vhosts-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: iron_vhosts-0.5.0

Iron Vhosts

Vhost handler for the Iron web framework.

Example

fn main () {
    //Default handler passed to new
    let mut vhosts = Vhosts::new(|_: &mut Request| Ok(Response::with((status::Ok, "vhost"))));

    //Add any host specific handlers
    vhosts.add_host("localhost", localhost_handler);

    fn localhost_handler(_: &mut Request) -> IronResult<Response> {
        Ok(Response::with((status::Ok, "localhost")))
    }
}

Installation

If you're using cargo, just add iron_vhosts to your Cargo.toml.

[dependencies]

iron_vhosts = "*"