Crates.io | mudpie |
lib.rs | mudpie |
version | 0.2.6 |
source | src |
created_at | 2015-01-21 21:47:53.162905 |
updated_at | 2015-12-11 23:54:29.779751 |
description | Dynamic HTTP Server. Pure safe Rust, no dependencies. |
homepage | |
repository | https://github.com/kjpgit/mudpie |
max_upload_size | |
id | 849 |
size | 2,800,983 |
= Mudpie
:app: Mudpie
== Overview
{app} is a simple multi-threaded HTTP server for the amazingly awesome Rust language. It is inspired by Python's WSGI specification.
{app} is written in 100% safe Rust code (no unsafe blocks) and has no dependencies. It is intended to be reliable and easy to audit for security, especially for embedded applications.
NOTE: The {app} master
branch is for Rust nightly.
== Hello World Code
extern crate mudpie; use mudpie::{WebServer, WebRequest, WebResponse};
fn hello(req: &WebRequest) -> WebResponse { let page = "
== Running the Demo Server
Use +cargo run+ to start the included demo server, which has some example pages you can visit at +http://localhost:8000/+.
$ cargo run 0.0.0.0 8000
Running `target/demo 0.0.0.0 8000`
You can benchmark it using a program like "boom" or any other HTTP tester:
$ ./goprograms/bin/boom -n 100000 -c 10 -cpus 3 http://localhost:8000/bench
NOTE: You should probably turn request logging off (export MUDPIE_LOGGING=0
)
or redirect it to /dev/null
when benchmarking, and also use cargo run --release
to enable compiler optimizations.
== More Information
The link:src/bin/demo.rs[Demo Program] shows example usage
The link:http://www.rust-ci.org/kjpgit/mudpie/doc/mudpie/[Mudpie Crate API Docs]
The link:Internals.adoc[Internals] has gory architecture and protocol details
== License
Public Domain.