Httiple aims to make HTTP/2 over TLS in rust simple. It adopts a Express-like interface.
- A basic implementation of the h2 standard.
- A per stream state based handler.
- A simple interface.
- Continous Deployment (deploys to crates.io)
- Making the implementation of HTTP/2 work in all browsers (currently only working in chrome)
- Fix TLS errors (Don't know if this is my fault of rustls)
- Implement the missing frametypes.
- Add support for priority.
- Make the callback a future.
- Implement a propper hpack lib in rust (the one used currently seems a bit broken)
- Serving static files (started, but currently impossible to make multiple requests)
- Write tests for everything. My testing library I was working around does not have TLS support.
- Improve tls setup process.
- Adding an ORM and mongodb (a lot of this is done in https://github.com/halvorboe/rust-rest) to possible make it more like Django Framework.
cargo new myserver
Add an index.html and a certificate in the main folder. Name the certificate folder "ca".
Add this to your Cargo.toml
[dependencies]
httimple = "*"
Make a file containing this and name it main.rs.
extern crate httimple;
use httimple::app::App;
use httimple::app::message::Message;
use httimple::app::call::Call;
use httimple::helpers::file;
fn main() {
let mut app = App::new();
app.serve("/", | call: &Call | -> Message {
Message::from(file("index.html"))
});
app.start();
}
cargo run --release
bitreader -> Handles the reading of blocks. Could be removed in favor of binary operations, but it makes the code easier to read.
mio = "0.6.14" -> Handles the async io.
rustls = "0.12.0" -> TLS
hpack_codec = "0.1.0" -> Handles decoding and encoding of headers. Seems broken to some degree.
To run the tests, clone this repo and run:
cargo test