There’s a project that I’d been meaning to try with Rust, and that’s write a basic web server. I kept putting it off, and when I saw the 0.6 rc land recently, I said I’d give it a try to play with 0.6. But schaars has beaten me to it, and released simple-web-server today.
simple-web-server was written with Rust 0.5 in mind. It’s pretty easy to build, just use
$ cd rust $ make
Trying it out is easy, too:
$ ./ws -p port -s pool_size -d web_dir
Right now, the server is simple, very simple. It only supports GET requests as HTTP/1.0. That said, that’s enough to qualify, and it’s certainly enough to toy around with Rust. As schaars says,
The goal is not performance, but rather discovering the language and building a simple distributed system.
Rust’s concurrency features, used properly, should make for a really awesome web server. I’m excited to see what happens when a production-ready one comes out.