A high-powered web server aimed at minimizing dependencies while maintaining speed. Modeled after Express, a popular Javascript web framework, Octane combines the speed of Rust with the ease-of-use and flexibility of Express to create the optimal user experience.
- Multithreaded 🚄
- Asynchronous design 🐆
- Easy to use, intuitive design 🌱
- TLS enabled, rustls/openssl ready 🔒
- Minimal dependencies (working to reduce them more!) 💕
- no_std wasip3 support using fixed stack sizes! 💕
The initial version of this web server was written by hand, both the parser and router 5 years ago during 2020. Since then there's various fuzzing implementations and tests to test the integrity of the server. The web server also had audits from OpenAI's daybreak models and Claude's capability scanning. Since the web server uses minimal dependencies, the attack vector is also reduced.
This web server is supposed to be a deterministic set of codes that people can use in production. A web server doesn't need huge dependencies, large binary sizes or build times. When developing for WASM targets, the binary
size matters even if you are running the guest program on a server using wasmtime
Templating frameworks like topcoat should be supported on top of Octane, since Octane is an OS agnostic http implementation.
Create an octane instance, and then you can register your methods on it using app.METHOD()
use octane::prelude::*;
use std::error::Error;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let mut app = Octane::new();
app.ssl(8001)
.key("templates/key.pem")
.cert("templates/cert.pem"); // Setup ssl
app.get(
"/",
route!(|req, res| {
res.send_file("templates/test.html").expect("File not found!");
Flow::Next
}),
)?;
app.add(Octane::static_dir("templates"))?;
app.listen(8000, || println!("Server Started!")).await
}Documentation will be available on docs.rs.
- Http2
- Stable SSL support
- Efficient error handling (using enums instead of
Box<dyn Error>) - Web socket library
- Multipart/json form handling (being worked on)
- Tracing
- Topcoat/Dixous support
- Much more....
Checkout CONTRIBUTING.md for info on how to contribute to this project
OctaneWeb/Octane is licensed under the MIT License.