tiny_http 0.4.1

Low level HTTP server library
Documentation
extern crate tiny_http;

use std::sync::Arc;
use std::thread;

fn main() {
    let server = Arc::new(tiny_http::ServerBuilder::new().with_port(9975).build().unwrap());
    println!("Now listening on port 9975");

    let mut handles = Vec::new();

    for _ in (0 .. 4) {
        let server = server.clone();

        handles.push(thread::spawn(move || {
            for rq in server.incoming_requests() {
                let response = tiny_http::Response::from_string("hello world".to_string());
                rq.respond(response);
            }
        }));
    }

    for h in handles {
        h.join().unwrap();
    }
}