Skip to content
rok-langPublic

About

HTTP/1.1 and HTTP/2 client and server for Rok

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

http

HTTP/1.1 and HTTP/2 for Rok: a message model, a pooling client and an async server, over plaintext or TLS 1.3. Built on rok::std::net with no other dependencies. Parsing is strict where leniency would allow request smuggling or response splitting.

Add it

rok add http

Needs Rok 0.2 or later; Rok 0.1 is no longer supported and cannot read the stone index.

Features http1, http2 and tls are on by default; turn off what you do not need with default_features: false.

Usage

// One-off request with a default client.
let r = try await http::get("http://example.com/");
println(f"{r.status} {r.headers.get("content-type") ?? "-"}");
println(try await r.body.text());

The server is router-free: one async fn(Request) -> Response handler, served with http::serve / http::serve_tls. See the API docs for the client, server and TLS details.

Docs

https://docs.rok-lang.org

License

Licensed under either of MIT or Apache-2.0, at your option.

About

HTTP/1.1 and HTTP/2 client and server for Rok

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Contributors