Crates.io | httpbis |
lib.rs | httpbis |
version | 0.9.1 |
source | src |
created_at | 2017-01-08 23:11:21.389108 |
updated_at | 2020-06-21 06:21:21.2917 |
description | Rust implementation of HTTP/2 protocol |
homepage | |
repository | https://github.com/stepancheg/rust-http2 |
max_upload_size | |
id | 7993 |
size | 674,425 |
HTTP/2 client and server implementation in Rust based on tokio.
Currently it is used as base for implementation of grpc-rust.
Checkout the source code and execute command:
cargo run --example server
Server will be available on https://localhost:8443/. You need any modern browser with HTTP/2 support to open the page (e. g. Firefox, Safari, Chrome).
Server only works over HTTP/2, if browser doesn't send HTTP/2 preface, server closes the connection.
cargo run --example client https://google.com/
Result is:
:status: 302
cache-control: private
content-type: text/html; charset=UTF-8
referrer-policy: no-referrer
location: https://www.google.ru/?gfe_rd=cr&ei=mZQ4WZfaGISDZOzOktgO
content-length: 257
date: Thu, 08 Jun 2017 00:04:41 GMT
alt-svc: quic=":443"; ma=2592000; v="38,37,36,35"
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="https://www.google.ru/?gfe_rd=cr&ei=mZQ4WZfaGISDZOzOktgO">here</A>.
</BODY></HTML>