12 releases

Uses old Rust 2015

0.1.11+1.64.0 Jan 11, 2025
0.1.10+1.61.0 Apr 12, 2024
0.1.9+1.58.0 Jan 2, 2024
0.1.8+1.55.1 Aug 7, 2023
0.1.1 Nov 25, 2018

#130 in HTTP server

Download history 128640/week @ 2024-11-18 116475/week @ 2024-11-25 130138/week @ 2024-12-02 133244/week @ 2024-12-09 137496/week @ 2024-12-16 77136/week @ 2024-12-23 77355/week @ 2024-12-30 118926/week @ 2025-01-06 146149/week @ 2025-01-13 127408/week @ 2025-01-20 123474/week @ 2025-01-27 147326/week @ 2025-02-03 147765/week @ 2025-02-10 146424/week @ 2025-02-17 128659/week @ 2025-02-24 125535/week @ 2025-03-03

556,802 downloads per month
Used in 201 crates (2 directly)

MIT/Apache

7.5MB
199K SLoC

C 108K SLoC // 0.1% comments C++ 50K SLoC // 0.1% comments Ruby 23K SLoC // 0.2% comments Happy 7K SLoC Go 5.5K SLoC // 0.1% comments Python 2K SLoC // 0.3% comments Rust 1.5K SLoC // 0.0% comments Automake 1.5K SLoC // 0.2% comments M4 877 SLoC // 0.2% comments Batch 232 SLoC RPM Specfile 59 SLoC Shell 16 SLoC

Contains (obscure autoconf code, 42KB) nghttp2/configure.ac

nghttp2-sys

A common library for linking nghttp2 to rust programs (also known as libnghttp2).

Generating bindings

Before bindgen:

  • Copy nghttp2ver.h.in to nghttp2ver.h
  • Edit nghttp2ver.h to remove @FOO@, replacing with 0
$ bindgen \
  ./nghttp2/lib/includes/nghttp2/nghttp2.h \
  -o src/lib.rs \
  --no-layout-tests \
  --distrust-clang-mangling \
  --no-prepend-enum-name \
  --rustfmt-bindings \
  --whitelist-function '.*nghttp2.*' \
  --whitelist-type '.*nghttp2.*' \
  --whitelist-var '.*nghttp2.*' \
  -- \
  -I ./nghttp2/lib/includes

Afterwards

  • Remove *vprintf*
  • Remove va_list-related things
  • Add #![allow(bad_style)]

License

This project is licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in nghttp2-sys by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies