#http2

bin+lib httpbis

Rust implementation of HTTP/2 protocol

29 releases

0.9.1 Jun 21, 2020
0.8.0 Apr 27, 2020
0.7.0 Jun 16, 2018
0.4.2 Mar 31, 2018
0.1.1 Jan 8, 2017

#17 in #http2

Download history 2575/week @ 2022-11-28 1554/week @ 2022-12-05 1910/week @ 2022-12-12 3804/week @ 2022-12-19 1648/week @ 2022-12-26 4235/week @ 2023-01-02 2525/week @ 2023-01-09 3017/week @ 2023-01-16 2894/week @ 2023-01-23 3703/week @ 2023-01-30 2402/week @ 2023-02-06 2569/week @ 2023-02-13 4437/week @ 2023-02-20 3771/week @ 2023-02-27 6524/week @ 2023-03-06 7854/week @ 2023-03-13

22,852 downloads per month
Used in 18 crates (3 directly)

MIT/Apache

650KB
15K SLoC

rust-http2

Build Status License crates.io

HTTP/2 client and server implementation in Rust based on tokio.

Currently it is used as base for implementation of grpc-rust.

Example server

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.

Example client

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&amp;ei=mZQ4WZfaGISDZOzOktgO">here</A>.
</BODY></HTML>

Dependencies

~4.5MB
~72K SLoC