mirror of
https://github.com/nghttp2/nghttp2.git
synced 2025-12-08 02:58:53 +08:00
Compare commits
329 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec542f140b | ||
|
|
39a2a2437c | ||
|
|
a073dfc633 | ||
|
|
d2ba169f79 | ||
|
|
a629a0c677 | ||
|
|
dbe287ff5e | ||
|
|
61dc1a7c62 | ||
|
|
dc1e0c0195 | ||
|
|
041531458b | ||
|
|
1374bb81fd | ||
|
|
f41ac103d3 | ||
|
|
f6301714db | ||
|
|
7dc39b1ee9 | ||
|
|
696a7ce407 | ||
|
|
d28d788623 | ||
|
|
99122ee7bb | ||
|
|
19ee7ec794 | ||
|
|
cd9ec0d20f | ||
|
|
e77883e980 | ||
|
|
0994c92550 | ||
|
|
465c7208cc | ||
|
|
4f9f181f07 | ||
|
|
b7e7a4bf26 | ||
|
|
c7df65309b | ||
|
|
26900262f3 | ||
|
|
9b5ce36368 | ||
|
|
f69b52b1aa | ||
|
|
1e1d908c12 | ||
|
|
6c69d675da | ||
|
|
feabd6f739 | ||
|
|
1ea590c364 | ||
|
|
b21779e685 | ||
|
|
12a4e7c3a2 | ||
|
|
799a76de74 | ||
|
|
b1fee8ff63 | ||
|
|
9cc223d419 | ||
|
|
20edd64301 | ||
|
|
9aee518352 | ||
|
|
6ca515ea70 | ||
|
|
51b933c5f0 | ||
|
|
3f13d33543 | ||
|
|
85a12429ee | ||
|
|
3e0e3f5459 | ||
|
|
801869a5d5 | ||
|
|
54f4b85beb | ||
|
|
fa074145a4 | ||
|
|
b2d6550179 | ||
|
|
62dd1f5177 | ||
|
|
dc7c12d474 | ||
|
|
a6dda5f91c | ||
|
|
c1f7795dd6 | ||
|
|
4989e6e419 | ||
|
|
d4963bcd32 | ||
|
|
d725255784 | ||
|
|
5f4159a0d7 | ||
|
|
0a2a5e6604 | ||
|
|
acd05f2aa5 | ||
|
|
bb7718a64a | ||
|
|
e59fc725ab | ||
|
|
4fcd0fc144 | ||
|
|
373be22d7e | ||
|
|
b647a7c5b7 | ||
|
|
46ba9e080d | ||
|
|
e1b8317ae8 | ||
|
|
ea67864e08 | ||
|
|
6b286e0d94 | ||
|
|
d10ea5ea06 | ||
|
|
2af57c3cfc | ||
|
|
0c8b1a4f74 | ||
|
|
9d16292fe4 | ||
|
|
e2b9590c0f | ||
|
|
24fb640a55 | ||
|
|
e6a05cb66d | ||
|
|
12f9b09845 | ||
|
|
102b98813f | ||
|
|
1f55e5d34d | ||
|
|
5618e1bbc9 | ||
|
|
450ffaa6f0 | ||
|
|
dc15832030 | ||
|
|
0797e89a90 | ||
|
|
9f1543f81e | ||
|
|
a7c780a732 | ||
|
|
1bd6893084 | ||
|
|
ae21130b13 | ||
|
|
e06ed85747 | ||
|
|
83fd72c97e | ||
|
|
ace40f298d | ||
|
|
1133cc0bbc | ||
|
|
6960039aee | ||
|
|
bf5eeb831b | ||
|
|
e5b84fad09 | ||
|
|
cfb39171a7 | ||
|
|
2f6e1ac336 | ||
|
|
9e8d9d658a | ||
|
|
6ecfac6954 | ||
|
|
368775c2ed | ||
|
|
1e9a094edd | ||
|
|
ceb4dcf3b2 | ||
|
|
d2ef80fe3a | ||
|
|
79ae5aed67 | ||
|
|
56e86cd944 | ||
|
|
19a311ad62 | ||
|
|
b36e53cccd | ||
|
|
f3a5a0a0ec | ||
|
|
001d45efad | ||
|
|
56c455bca4 | ||
|
|
4bf3cb2cc0 | ||
|
|
c78528d54b | ||
|
|
f994664934 | ||
|
|
44e290da66 | ||
|
|
8aed101585 | ||
|
|
54ba1bebf2 | ||
|
|
e44c58282e | ||
|
|
c02b1041d9 | ||
|
|
0d20e07436 | ||
|
|
b7f956c967 | ||
|
|
786f52a81c | ||
|
|
23209baaf5 | ||
|
|
9d2503f9c0 | ||
|
|
1c31213aef | ||
|
|
fdb75ba5fe | ||
|
|
8f888b29bd | ||
|
|
298808f276 | ||
|
|
a231874e1e | ||
|
|
2101f4ae3f | ||
|
|
4a06f9684f | ||
|
|
5f31c09410 | ||
|
|
9a85c5264a | ||
|
|
fd475e4b2f | ||
|
|
5dc1d116c9 | ||
|
|
c566d3f475 | ||
|
|
68a724cf7b | ||
|
|
779ec50e73 | ||
|
|
aad3e275d1 | ||
|
|
1649948e78 | ||
|
|
6d3e010ae7 | ||
|
|
7dddac081e | ||
|
|
588dd33241 | ||
|
|
f0b6b9508d | ||
|
|
14ccb24be5 | ||
|
|
025ec85144 | ||
|
|
bd97886d8e | ||
|
|
0b1ddad62b | ||
|
|
540853bde8 | ||
|
|
c757f7d848 | ||
|
|
052f3a3871 | ||
|
|
2ae83e871b | ||
|
|
1cc08c0a51 | ||
|
|
16be89f9cc | ||
|
|
3ddc446ba2 | ||
|
|
b72c5f104e | ||
|
|
7e6eb7e02a | ||
|
|
712b08e8ed | ||
|
|
fbf156d22d | ||
|
|
965a0e87e5 | ||
|
|
2b55ca1ce6 | ||
|
|
534c01896c | ||
|
|
c25197ac40 | ||
|
|
becae65257 | ||
|
|
ba9f2c3ae2 | ||
|
|
0387525b77 | ||
|
|
5311185333 | ||
|
|
2fc2a27ac1 | ||
|
|
db938afd66 | ||
|
|
89ddc47616 | ||
|
|
90b7849af1 | ||
|
|
3176e872b3 | ||
|
|
16206d5f67 | ||
|
|
0f33749790 | ||
|
|
5e7e4c0cc0 | ||
|
|
25503ad763 | ||
|
|
8f513fceca | ||
|
|
91af4ed70d | ||
|
|
685e926494 | ||
|
|
a2afd393ed | ||
|
|
4e9098bccf | ||
|
|
33aa327ef5 | ||
|
|
9067ff5eee | ||
|
|
efeede4192 | ||
|
|
6a8749873f | ||
|
|
b1b8308555 | ||
|
|
9b574a5a76 | ||
|
|
0567f1f038 | ||
|
|
4be5de1163 | ||
|
|
9db1c9467c | ||
|
|
3444b42d44 | ||
|
|
6595ae26ea | ||
|
|
41d8a3ac09 | ||
|
|
175001a8d9 | ||
|
|
7cf9e00283 | ||
|
|
8a3eb3f066 | ||
|
|
7e1a0d204b | ||
|
|
cbca2e35b5 | ||
|
|
fc9bdf024f | ||
|
|
3f97e6cd3a | ||
|
|
4fa150c494 | ||
|
|
e8b2508036 | ||
|
|
ac399e41ac | ||
|
|
95dd908834 | ||
|
|
9c7e54d9b5 | ||
|
|
3c03024881 | ||
|
|
36dfc0a56a | ||
|
|
55bf6cdb15 | ||
|
|
0abc220013 | ||
|
|
c28900990a | ||
|
|
5108193d7b | ||
|
|
79a24f5dd9 | ||
|
|
83c759572c | ||
|
|
1a07fb000b | ||
|
|
4aab15999d | ||
|
|
441982674f | ||
|
|
8256c6e070 | ||
|
|
ae87a44b94 | ||
|
|
87d1692e27 | ||
|
|
1d2f008656 | ||
|
|
b064d8a9ff | ||
|
|
528af200b6 | ||
|
|
c6827a7dac | ||
|
|
55ecb082ee | ||
|
|
5f2cf461e6 | ||
|
|
b313386988 | ||
|
|
3933280d29 | ||
|
|
2b6073900f | ||
|
|
d1ba43a69f | ||
|
|
a0779edec4 | ||
|
|
d70fefe72f | ||
|
|
b52db072f1 | ||
|
|
ab0b98db61 | ||
|
|
4245d98653 | ||
|
|
93b4866f5b | ||
|
|
25df164219 | ||
|
|
ba03c082e9 | ||
|
|
bcfa333322 | ||
|
|
c4aeadd57d | ||
|
|
e6b4454e48 | ||
|
|
3226d21609 | ||
|
|
3d20c2dce6 | ||
|
|
cd83d70e7b | ||
|
|
a0ce5ea9ab | ||
|
|
3c600c103f | ||
|
|
841ac75c3e | ||
|
|
80a96817aa | ||
|
|
ecc05e0a1a | ||
|
|
359730af54 | ||
|
|
e9cb19c80e | ||
|
|
049e064e28 | ||
|
|
0463928a1e | ||
|
|
02d34c8c4c | ||
|
|
46acf32c41 | ||
|
|
cab0a76795 | ||
|
|
0c76cebbfc | ||
|
|
5029b85b25 | ||
|
|
0b71d9b828 | ||
|
|
464d7c4ec6 | ||
|
|
ed21b631ae | ||
|
|
950e2d9954 | ||
|
|
71c054a789 | ||
|
|
d2f456e5b1 | ||
|
|
30a44b26d3 | ||
|
|
7dff758f8b | ||
|
|
bd3ececdd8 | ||
|
|
77416b0ac2 | ||
|
|
fce9efd341 | ||
|
|
928fda1d70 | ||
|
|
2d9d654507 | ||
|
|
7398e57174 | ||
|
|
503ec82f4d | ||
|
|
22bd9fb530 | ||
|
|
e007b6b031 | ||
|
|
c487cd888f | ||
|
|
fd403a85c8 | ||
|
|
a06a8c36a4 | ||
|
|
0967ee9cb9 | ||
|
|
d66d34f9b9 | ||
|
|
264a98d106 | ||
|
|
7c11d2d9bb | ||
|
|
b58d7b406f | ||
|
|
5ed9e4c83b | ||
|
|
e7da2a669e | ||
|
|
d66377d4b6 | ||
|
|
77a324fa46 | ||
|
|
38b5cad4e3 | ||
|
|
29014643a9 | ||
|
|
0872f6babe | ||
|
|
b6a9cf9ffa | ||
|
|
5645cad577 | ||
|
|
85ba33c08f | ||
|
|
ff64f64e1d | ||
|
|
bdd3425028 | ||
|
|
70e02cddd3 | ||
|
|
d1c0a17cc2 | ||
|
|
35c5cbbc21 | ||
|
|
2ff31bdd2b | ||
|
|
2fa3d34af1 | ||
|
|
fa3452ec68 | ||
|
|
7451f2f212 | ||
|
|
e9ab75a386 | ||
|
|
d83949bc88 | ||
|
|
50f42a80c9 | ||
|
|
00bd76fc3d | ||
|
|
93ea6b581e | ||
|
|
8e52a5c7f3 | ||
|
|
0aa35e574a | ||
|
|
5a81f2441f | ||
|
|
2b75aff32e | ||
|
|
f4474d57ec | ||
|
|
d0310c8aee | ||
|
|
8471c9e92e | ||
|
|
f5a4c9d971 | ||
|
|
a0dd8918eb | ||
|
|
baa9b1cac0 | ||
|
|
38443d2195 | ||
|
|
208d71561a | ||
|
|
25fbc7b435 | ||
|
|
6bd95d885d | ||
|
|
c171097dea | ||
|
|
6bcdb178a5 | ||
|
|
5e10cc4cad | ||
|
|
95e6c875f0 | ||
|
|
6eb2829ee8 | ||
|
|
6ad9ddcdea | ||
|
|
e082b7be72 | ||
|
|
da01d8dedb | ||
|
|
ca6f6511f2 | ||
|
|
ee8440408c | ||
|
|
9cd695a1db | ||
|
|
4b45906f46 | ||
|
|
d448eb54f9 | ||
|
|
65739fe754 |
@@ -28,6 +28,7 @@ addons:
|
|||||||
- libevent-dev
|
- libevent-dev
|
||||||
- libjansson-dev
|
- libjansson-dev
|
||||||
- libjemalloc-dev
|
- libjemalloc-dev
|
||||||
|
- libc-ares-dev
|
||||||
- cmake
|
- cmake
|
||||||
- cmake-data
|
- cmake-data
|
||||||
before_install:
|
before_install:
|
||||||
@@ -54,7 +55,8 @@ before_script:
|
|||||||
- if [ "$CI_BUILD" = "autotools" ]; then ./configure --enable-werror --with-mruby --with-neverbleed LIBSPDYLAY_CFLAGS="-I$SPDYLAY_HOME/lib/includes" LIBSPDYLAY_LIBS="-L$SPDYLAY_HOME/lib/.libs -lspdylay" CPPFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address; fi
|
- if [ "$CI_BUILD" = "autotools" ]; then ./configure --enable-werror --with-mruby --with-neverbleed LIBSPDYLAY_CFLAGS="-I$SPDYLAY_HOME/lib/includes" LIBSPDYLAY_LIBS="-L$SPDYLAY_HOME/lib/.libs -lspdylay" CPPFLAGS=-fsanitize=address LDFLAGS=-fsanitize=address; fi
|
||||||
- if [ "$CI_BUILD" = "cmake" ]; then cmake -DENABLE_WERROR=1 -DWITH_MRUBY=1 -DWITH_NEVERBLEED=1 -DSPDYLAY_INCLUDE_DIR="$SPDYLAY_HOME/lib/includes" -DSPDYLAY_LIBRARY="$SPDYLAY_HOME/lib/.libs/libspdylay.so"; fi
|
- if [ "$CI_BUILD" = "cmake" ]; then cmake -DENABLE_WERROR=1 -DWITH_MRUBY=1 -DWITH_NEVERBLEED=1 -DSPDYLAY_INCLUDE_DIR="$SPDYLAY_HOME/lib/includes" -DSPDYLAY_LIBRARY="$SPDYLAY_HOME/lib/.libs/libspdylay.so"; fi
|
||||||
script:
|
script:
|
||||||
- make check
|
- if [ "$CI_BUILD" = "autotools" ]; then make distcheck; fi
|
||||||
|
- if [ "$CI_BUILD" = "cmake" ]; then make check; fi
|
||||||
# As of April, 23, 2016, golang http2 build fails, probably because
|
# As of April, 23, 2016, golang http2 build fails, probably because
|
||||||
# the default go version is too old.
|
# the default go version is too old.
|
||||||
# - cd integration-tests
|
# - cd integration-tests
|
||||||
|
|||||||
10
AUTHORS
10
AUTHORS
@@ -17,10 +17,14 @@ github issues [2].
|
|||||||
Alek Storm
|
Alek Storm
|
||||||
Alex Nalivko
|
Alex Nalivko
|
||||||
Alexis La Goutte
|
Alexis La Goutte
|
||||||
|
Amir Pakdel
|
||||||
Anders Bakken
|
Anders Bakken
|
||||||
Andreas Pohl
|
Andreas Pohl
|
||||||
Andy Davies
|
Andy Davies
|
||||||
Ant Bryan
|
Ant Bryan
|
||||||
|
Benedikt Christoph Wolters
|
||||||
|
Benedikt Christoph Wolters
|
||||||
|
Bernard Spil
|
||||||
Bernard Spil
|
Bernard Spil
|
||||||
Brian Card
|
Brian Card
|
||||||
Brian Suh
|
Brian Suh
|
||||||
@@ -32,6 +36,7 @@ Etienne Cimon
|
|||||||
Fabian Möller
|
Fabian Möller
|
||||||
Fabian Wiesel
|
Fabian Wiesel
|
||||||
Gabi Davar
|
Gabi Davar
|
||||||
|
Google Inc.
|
||||||
Jacob Champion
|
Jacob Champion
|
||||||
Jan-E
|
Jan-E
|
||||||
Janusz Dziemidowicz
|
Janusz Dziemidowicz
|
||||||
@@ -47,6 +52,7 @@ Kit Chan
|
|||||||
Kyle Schomp
|
Kyle Schomp
|
||||||
Lucas Pardue
|
Lucas Pardue
|
||||||
MATSUMOTO Ryosuke
|
MATSUMOTO Ryosuke
|
||||||
|
Matt Rudary
|
||||||
Mike Conlen
|
Mike Conlen
|
||||||
Mike Frysinger
|
Mike Frysinger
|
||||||
Nicholas Hurley
|
Nicholas Hurley
|
||||||
@@ -68,6 +74,7 @@ Tatsuhiko Kubo
|
|||||||
Tatsuhiro Tsujikawa
|
Tatsuhiro Tsujikawa
|
||||||
Tom Harwood
|
Tom Harwood
|
||||||
Tomasz Buchert
|
Tomasz Buchert
|
||||||
|
Tomasz Torcz
|
||||||
Vernon Tang
|
Vernon Tang
|
||||||
Viacheslav Biriukov
|
Viacheslav Biriukov
|
||||||
Viktor Szépe
|
Viktor Szépe
|
||||||
@@ -77,9 +84,12 @@ Zhuoyun Wei
|
|||||||
acesso
|
acesso
|
||||||
ayanamist
|
ayanamist
|
||||||
bxshi
|
bxshi
|
||||||
|
clemahieu
|
||||||
|
dalf
|
||||||
es
|
es
|
||||||
fangdingjun
|
fangdingjun
|
||||||
kumagi
|
kumagi
|
||||||
|
makovich
|
||||||
mod-h2-dev
|
mod-h2-dev
|
||||||
moparisthebest
|
moparisthebest
|
||||||
snnn
|
snnn
|
||||||
|
|||||||
@@ -24,13 +24,13 @@
|
|||||||
|
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.0)
|
||||||
# XXX using 1.8.90 instead of 1.9.0-DEV
|
# XXX using 1.8.90 instead of 1.9.0-DEV
|
||||||
project(nghttp2 VERSION 1.16.0)
|
project(nghttp2 VERSION 1.21.1)
|
||||||
|
|
||||||
# See versioning rule:
|
# See versioning rule:
|
||||||
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
||||||
set(LT_CURRENT 26)
|
set(LT_CURRENT 27)
|
||||||
set(LT_REVISION 0)
|
set(LT_REVISION 1)
|
||||||
set(LT_AGE 12)
|
set(LT_AGE 13)
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
include(Version)
|
include(Version)
|
||||||
@@ -59,6 +59,7 @@ find_package(PythonInterp)
|
|||||||
# Auto-detection of features that can be toggled
|
# Auto-detection of features that can be toggled
|
||||||
find_package(OpenSSL 1.0.1)
|
find_package(OpenSSL 1.0.1)
|
||||||
find_package(Libev 4.11)
|
find_package(Libev 4.11)
|
||||||
|
find_package(Libcares 1.7.5)
|
||||||
find_package(ZLIB 1.2.3)
|
find_package(ZLIB 1.2.3)
|
||||||
if(OPENSSL_FOUND AND LIBEV_FOUND AND ZLIB_FOUND)
|
if(OPENSSL_FOUND AND LIBEV_FOUND AND ZLIB_FOUND)
|
||||||
set(ENABLE_APP_DEFAULT ON)
|
set(ENABLE_APP_DEFAULT ON)
|
||||||
@@ -109,19 +110,9 @@ foreach(_build_type "Release" "MinSizeRel" "RelWithDebInfo")
|
|||||||
endforeach()
|
endforeach()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
#
|
|
||||||
# If we're running GCC or clang define _U_ to be "__attribute__((unused))"
|
|
||||||
# so we can use _U_ to flag unused function parameters and not get warnings
|
|
||||||
# about them. Otherwise, define _U_ to be an empty string so that _U_ used
|
|
||||||
# to flag an unused function parameters will compile with other compilers.
|
|
||||||
#
|
|
||||||
# XXX - similar hints for other compilers?
|
|
||||||
#
|
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
if(CMAKE_C_COMPILER_ID MATCHES "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||||
set(HINT_UNUSED_PARAM "__attribute__((unused))")
|
|
||||||
set(HINT_NORETURN "__attribute__((noreturn))")
|
set(HINT_NORETURN "__attribute__((noreturn))")
|
||||||
else()
|
else()
|
||||||
set(HINT_UNUSED_PARAM)
|
|
||||||
set(HINT_NORETURN)
|
set(HINT_NORETURN)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -207,6 +198,14 @@ if(LIBEVENT_FOUND)
|
|||||||
# Must both link the core and openssl libraries.
|
# Must both link the core and openssl libraries.
|
||||||
set(LIBEVENT_OPENSSL_LIBRARIES ${LIBEVENT_LIBRARIES})
|
set(LIBEVENT_OPENSSL_LIBRARIES ${LIBEVENT_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
# libc-ares (for src)
|
||||||
|
set(HAVE_LIBCARES ${LIBCARES_FOUND})
|
||||||
|
if(LIBCARES_FOUND)
|
||||||
|
set(LIBCARES_INCLUDE_DIRS ${LIBCARES_INCLUDE_DIR})
|
||||||
|
else()
|
||||||
|
set(LIBCARES_INCLUDE_DIRS "")
|
||||||
|
set(LIBCARES_LIBRARIES "")
|
||||||
|
endif()
|
||||||
# jansson (for src/nghttp, src/deflatehd and src/inflatehd)
|
# jansson (for src/nghttp, src/deflatehd and src/inflatehd)
|
||||||
set(HAVE_JANSSON ${JANSSON_FOUND})
|
set(HAVE_JANSSON ${JANSSON_FOUND})
|
||||||
# libxml2 (for src/nghttp)
|
# libxml2 (for src/nghttp)
|
||||||
@@ -304,7 +303,6 @@ include(CheckFunctionExists)
|
|||||||
check_function_exists(_Exit HAVE__EXIT)
|
check_function_exists(_Exit HAVE__EXIT)
|
||||||
check_function_exists(accept4 HAVE_ACCEPT4)
|
check_function_exists(accept4 HAVE_ACCEPT4)
|
||||||
|
|
||||||
# timerfd_create was added in linux kernel 2.6.25
|
|
||||||
include(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
# XXX does this correctly detect initgroups (un)availability on cygwin?
|
# XXX does this correctly detect initgroups (un)availability on cygwin?
|
||||||
check_symbol_exists(initgroups grp.h HAVE_DECL_INITGROUPS)
|
check_symbol_exists(initgroups grp.h HAVE_DECL_INITGROUPS)
|
||||||
@@ -316,13 +314,6 @@ if(NOT HAVE_DECL_INITGROUPS AND HAVE_UNISTD_H)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_function_exists(timerfd_create HAVE_TIMERFD_CREATE)
|
|
||||||
# Checks for epoll availability, primarily for examples/tiny-nghttpd
|
|
||||||
check_symbol_exists(epoll_create sys/epoll.h HAVE_EPOLL)
|
|
||||||
if(HAVE_EPOLL AND HAVE_TIMERFD_CREATE)
|
|
||||||
set(ENABLE_TINY_NGHTTPD 1)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(WARNCFLAGS)
|
set(WARNCFLAGS)
|
||||||
set(WARNCXXFLAGS)
|
set(WARNCXXFLAGS)
|
||||||
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
|
||||||
@@ -499,6 +490,7 @@ message(STATUS "summary of build options:
|
|||||||
OpenSSL: ${HAVE_OPENSSL} (LIBS='${OPENSSL_LIBRARIES}')
|
OpenSSL: ${HAVE_OPENSSL} (LIBS='${OPENSSL_LIBRARIES}')
|
||||||
Libxml2: ${HAVE_LIBXML2} (LIBS='${LIBXML2_LIBRARIES}')
|
Libxml2: ${HAVE_LIBXML2} (LIBS='${LIBXML2_LIBRARIES}')
|
||||||
Libev: ${HAVE_LIBEV} (LIBS='${LIBEV_LIBRARIES}')
|
Libev: ${HAVE_LIBEV} (LIBS='${LIBEV_LIBRARIES}')
|
||||||
|
Libc-ares: ${HAVE_LIBCARES} (LIBS='${LIBCARES_LIBRARIES}')
|
||||||
Libevent(SSL): ${HAVE_LIBEVENT_OPENSSL} (LIBS='${LIBEVENT_OPENSSL_LIBRARIES}')
|
Libevent(SSL): ${HAVE_LIBEVENT_OPENSSL} (LIBS='${LIBEVENT_OPENSSL_LIBRARIES}')
|
||||||
Spdylay: ${HAVE_SPDYLAY} (LIBS='${SPDYLAY_LIBRARIES}')
|
Spdylay: ${HAVE_SPDYLAY} (LIBS='${SPDYLAY_LIBRARIES}')
|
||||||
Jansson: ${HAVE_JANSSON} (LIBS='${JANSSON_LIBRARIES}')
|
Jansson: ${HAVE_JANSSON} (LIBS='${JANSSON_LIBRARIES}')
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ EXTRA_DIST = nghttpx.conf.sample proxy.pac.sample android-config android-make \
|
|||||||
cmake/Version.cmake \
|
cmake/Version.cmake \
|
||||||
cmake/FindCython.cmake \
|
cmake/FindCython.cmake \
|
||||||
cmake/FindLibevent.cmake \
|
cmake/FindLibevent.cmake \
|
||||||
cmake/FindJansson.cmake
|
cmake/FindJansson.cmake \
|
||||||
|
cmake/FindLibcares.cmake
|
||||||
|
|
||||||
.PHONY: clang-format
|
.PHONY: clang-format
|
||||||
|
|
||||||
|
|||||||
48
README.rst
48
README.rst
@@ -70,6 +70,7 @@ are required:
|
|||||||
* OpenSSL >= 1.0.1
|
* OpenSSL >= 1.0.1
|
||||||
* libev >= 4.11
|
* libev >= 4.11
|
||||||
* zlib >= 1.2.3
|
* zlib >= 1.2.3
|
||||||
|
* libc-ares >= 1.7.5
|
||||||
|
|
||||||
ALPN support requires OpenSSL >= 1.0.2 (released 22 January 2015).
|
ALPN support requires OpenSSL >= 1.0.2 (released 22 January 2015).
|
||||||
LibreSSL >= 2.2.0 can be used instead of OpenSSL, but OpenSSL has more
|
LibreSSL >= 2.2.0 can be used instead of OpenSSL, but OpenSSL has more
|
||||||
@@ -80,11 +81,19 @@ To enable the SPDY protocol in the application program ``nghttpx`` and
|
|||||||
|
|
||||||
* spdylay >= 1.3.2
|
* spdylay >= 1.3.2
|
||||||
|
|
||||||
|
We no longer recommend to build nghttp2 with SPDY protocol support
|
||||||
|
enabled. SPDY support will be removed soon.
|
||||||
|
|
||||||
To enable ``-a`` option (getting linked assets from the downloaded
|
To enable ``-a`` option (getting linked assets from the downloaded
|
||||||
resource) in ``nghttp``, the following package is required:
|
resource) in ``nghttp``, the following package is required:
|
||||||
|
|
||||||
* libxml2 >= 2.7.7
|
* libxml2 >= 2.7.7
|
||||||
|
|
||||||
|
To enable systemd support in nghttpx, the following package is
|
||||||
|
required:
|
||||||
|
|
||||||
|
* libsystemd-dev >= 209
|
||||||
|
|
||||||
The HPACK tools require the following package:
|
The HPACK tools require the following package:
|
||||||
|
|
||||||
* jansson >= 2.5
|
* jansson >= 2.5
|
||||||
@@ -98,6 +107,11 @@ To mitigate heap fragmentation in long running server programs
|
|||||||
|
|
||||||
* jemalloc
|
* jemalloc
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Alpine Linux currently does not support malloc replacement
|
||||||
|
due to musl limitations. See details in issue `#762 <https://github.com/nghttp2/nghttp2/issues/762>`_.
|
||||||
|
|
||||||
libnghttp2_asio C++ library requires the following packages:
|
libnghttp2_asio C++ library requires the following packages:
|
||||||
|
|
||||||
* libboost-dev >= 1.54.0
|
* libboost-dev >= 1.54.0
|
||||||
@@ -109,15 +123,17 @@ The Python bindings require the following packages:
|
|||||||
* python >= 2.7
|
* python >= 2.7
|
||||||
* python-setuptools
|
* python-setuptools
|
||||||
|
|
||||||
If you are using Ubuntu 14.04 LTS (trusty) or Debian 7.0 (wheezy) and above run the following to install the needed packages:
|
If you are using Ubuntu 16.04 LTS (Xenial Xerus) or Debian 8 (jessie)
|
||||||
|
and above, run the following to install the required packages:
|
||||||
|
|
||||||
.. code-block:: text
|
.. code-block:: text
|
||||||
|
|
||||||
sudo apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config \
|
sudo apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config \
|
||||||
zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \
|
zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \
|
||||||
libjemalloc-dev cython python3-dev python-setuptools
|
libc-ares-dev libjemalloc-dev libsystemd-dev libspdylay-dev \
|
||||||
|
cython python3-dev python-setuptools
|
||||||
|
|
||||||
From Ubuntu 15.10, spdylay has been available as a package named
|
Since Ubuntu 15.10, spdylay has been available as a package named
|
||||||
`libspdylay-dev`. For the earlier Ubuntu release, you need to build
|
`libspdylay-dev`. For the earlier Ubuntu release, you need to build
|
||||||
it yourself: http://tatsuhiro-t.github.io/spdylay/
|
it yourself: http://tatsuhiro-t.github.io/spdylay/
|
||||||
|
|
||||||
@@ -149,6 +165,7 @@ used:
|
|||||||
|
|
||||||
.. code-block:: text
|
.. code-block:: text
|
||||||
|
|
||||||
|
$ git submodule update --init
|
||||||
$ autoreconf -i
|
$ autoreconf -i
|
||||||
$ automake
|
$ automake
|
||||||
$ autoconf
|
$ autoconf
|
||||||
@@ -159,8 +176,7 @@ To compile the source code, gcc >= 4.8.3 or clang >= 3.4 is required.
|
|||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
To enable mruby support in nghttpx, run ``git submodule update
|
To enable mruby support in nghttpx, and use ``--with-mruby``
|
||||||
--init`` before running configure script, and use ``--with-mruby``
|
|
||||||
configure option.
|
configure option.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
@@ -181,6 +197,28 @@ To compile the source code, gcc >= 4.8.3 or clang >= 3.4 is required.
|
|||||||
applications were not built, then using ``--enable-app`` may find
|
applications were not built, then using ``--enable-app`` may find
|
||||||
that cause, such as the missing dependency.
|
that cause, such as the missing dependency.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
In order to detect third party libraries, pkg-config is used
|
||||||
|
(however we don't use pkg-config for some libraries (e.g., libev)).
|
||||||
|
By default, pkg-config searches ``*.pc`` file in the standard
|
||||||
|
locations (e.g., /usr/lib/pkgconfig). If it is necessary to use
|
||||||
|
``*.pc`` file in the custom location, specify paths to
|
||||||
|
``PKG_CONFIG_PATH`` environment variable, and pass it to configure
|
||||||
|
script, like so:
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
$ ./configure PKG_CONFIG_PATH=/path/to/pkgconfig
|
||||||
|
|
||||||
|
For pkg-config managed libraries, ``*_CFLAG`` and ``*_LIBS``
|
||||||
|
environment variables are defined (e.g., ``OPENSSL_CFLAGS``,
|
||||||
|
``OPENSSL_LIBS``). Specifying non-empty string to these variables
|
||||||
|
completely overrides pkg-config. In other words, if they are
|
||||||
|
specified, pkg-config is not used for detection, and user is
|
||||||
|
responsible to specify the correct values to these variables. For
|
||||||
|
complete list of these variables, run ``./configure -h``.
|
||||||
|
|
||||||
Notes for building on Windows (MSVC)
|
Notes for building on Windows (MSVC)
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -39,8 +39,9 @@ PATH="$TOOLCHAIN"/bin:"$PATH"
|
|||||||
--without-libxml2 \
|
--without-libxml2 \
|
||||||
--disable-python-bindings \
|
--disable-python-bindings \
|
||||||
--disable-examples \
|
--disable-examples \
|
||||||
CC="$TOOLCHAIN"/bin/arm-linux-androideabi-gcc \
|
--disable-threads \
|
||||||
CXX="$TOOLCHAIN"/bin/arm-linux-androideabi-g++ \
|
CC="$TOOLCHAIN"/bin/arm-linux-androideabi-clang \
|
||||||
|
CXX="$TOOLCHAIN"/bin/arm-linux-androideabi-clang++ \
|
||||||
CPPFLAGS="-fPIE -I$PREFIX/include" \
|
CPPFLAGS="-fPIE -I$PREFIX/include" \
|
||||||
PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig" \
|
PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig" \
|
||||||
LDFLAGS="-fPIE -pie -L$PREFIX/lib"
|
LDFLAGS="-fPIE -pie -L$PREFIX/lib"
|
||||||
|
|||||||
53
appveyor.yml
Normal file
53
appveyor.yml
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
# Notes:
|
||||||
|
# - Minimal appveyor.yml file is an empty file. All sections are optional.
|
||||||
|
# - Indent each level of configuration with 2 spaces. Do not use tabs!
|
||||||
|
# - All section names are case-sensitive.
|
||||||
|
# - Section names should be unique on each level.
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# general configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
# version format
|
||||||
|
#version: 0.10.{build}
|
||||||
|
|
||||||
|
# branches to build
|
||||||
|
branches:
|
||||||
|
# blacklist
|
||||||
|
except:
|
||||||
|
- gh-pages
|
||||||
|
|
||||||
|
# Do not build on tags (GitHub only)
|
||||||
|
skip_tags: true
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# environment configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
os: Windows Server 2012
|
||||||
|
|
||||||
|
# scripts that run after cloning repository
|
||||||
|
install:
|
||||||
|
# install Win-Flex-Bison
|
||||||
|
#- cmd: cinst winflexbison -y
|
||||||
|
|
||||||
|
#---------------------------------#
|
||||||
|
# build configuration #
|
||||||
|
#---------------------------------#
|
||||||
|
|
||||||
|
# scripts to run before build
|
||||||
|
before_build:
|
||||||
|
- cmd: cmake .
|
||||||
|
|
||||||
|
# scripts to run *after* solution is built and *before* automatic packaging occurs (web apps, NuGet packages, Azure Cloud Services)
|
||||||
|
# before_package:
|
||||||
|
|
||||||
|
# scripts to run after build
|
||||||
|
# after_build:
|
||||||
|
|
||||||
|
# to run your custom scripts instead of automatic MSBuild
|
||||||
|
build_script:
|
||||||
|
- cmd: cmake --build .
|
||||||
|
|
||||||
|
# to disable automatic builds
|
||||||
|
# build: off
|
||||||
40
cmake/FindLibcares.cmake
Normal file
40
cmake/FindLibcares.cmake
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# - Try to find libcares
|
||||||
|
# Once done this will define
|
||||||
|
# LIBCARES_FOUND - System has libcares
|
||||||
|
# LIBCARES_INCLUDE_DIRS - The libcares include directories
|
||||||
|
# LIBCARES_LIBRARIES - The libraries needed to use libcares
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
pkg_check_modules(PC_LIBCARES QUIET libcares)
|
||||||
|
|
||||||
|
find_path(LIBCARES_INCLUDE_DIR
|
||||||
|
NAMES ares.h
|
||||||
|
HINTS ${PC_LIBCARES_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
find_library(LIBCARES_LIBRARY
|
||||||
|
NAMES cares
|
||||||
|
HINTS ${PC_LIBCARES_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
if(LIBCARES_INCLUDE_DIR)
|
||||||
|
set(_version_regex "^#define[ \t]+ARES_VERSION_STR[ \t]+\"([^\"]+)\".*")
|
||||||
|
file(STRINGS "${LIBCARES_INCLUDE_DIR}/ares_version.h"
|
||||||
|
LIBCARES_VERSION REGEX "${_version_regex}")
|
||||||
|
string(REGEX REPLACE "${_version_regex}" "\\1"
|
||||||
|
LIBCARES_VERSION "${LIBCARES_VERSION}")
|
||||||
|
unset(_version_regex)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
# handle the QUIETLY and REQUIRED arguments and set LIBCARES_FOUND to TRUE
|
||||||
|
# if all listed variables are TRUE and the requested version matches.
|
||||||
|
find_package_handle_standard_args(Libcares REQUIRED_VARS
|
||||||
|
LIBCARES_LIBRARY LIBCARES_INCLUDE_DIR
|
||||||
|
VERSION_VAR LIBCARES_VERSION)
|
||||||
|
|
||||||
|
if(LIBCARES_FOUND)
|
||||||
|
set(LIBCARES_LIBRARIES ${LIBCARES_LIBRARY})
|
||||||
|
set(LIBCARES_INCLUDE_DIRS ${LIBCARES_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(LIBCARES_INCLUDE_DIR LIBCARES_LIBRARY)
|
||||||
@@ -1,7 +1,3 @@
|
|||||||
|
|
||||||
/* Hint to the compiler that a function parameter is not used */
|
|
||||||
#define _U_ @HINT_UNUSED_PARAM@
|
|
||||||
|
|
||||||
/* Hint to the compiler that a function never returns */
|
/* Hint to the compiler that a function never returns */
|
||||||
#define NGHTTP2_NORETURN @HINT_NORETURN@
|
#define NGHTTP2_NORETURN @HINT_NORETURN@
|
||||||
|
|
||||||
|
|||||||
104
configure.ac
104
configure.ac
@@ -25,7 +25,7 @@ dnl Do not change user variables!
|
|||||||
dnl http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
|
dnl http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
|
||||||
|
|
||||||
AC_PREREQ(2.61)
|
AC_PREREQ(2.61)
|
||||||
AC_INIT([nghttp2], [1.16.0], [t-tujikawa@users.sourceforge.net])
|
AC_INIT([nghttp2], [1.21.1], [t-tujikawa@users.sourceforge.net])
|
||||||
AC_CONFIG_AUX_DIR([.])
|
AC_CONFIG_AUX_DIR([.])
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
AC_CONFIG_MACRO_DIR([m4])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
@@ -44,9 +44,9 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|||||||
|
|
||||||
dnl See versioning rule:
|
dnl See versioning rule:
|
||||||
dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
dnl http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
|
||||||
AC_SUBST(LT_CURRENT, 26)
|
AC_SUBST(LT_CURRENT, 27)
|
||||||
AC_SUBST(LT_REVISION, 0)
|
AC_SUBST(LT_REVISION, 1)
|
||||||
AC_SUBST(LT_AGE, 12)
|
AC_SUBST(LT_AGE, 13)
|
||||||
|
|
||||||
major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"`
|
major=`echo $PACKAGE_VERSION |cut -d. -f1 | sed -e "s/[^0-9]//g"`
|
||||||
minor=`echo $PACKAGE_VERSION |cut -d. -f2 | sed -e "s/[^0-9]//g"`
|
minor=`echo $PACKAGE_VERSION |cut -d. -f2 | sed -e "s/[^0-9]//g"`
|
||||||
@@ -119,8 +119,13 @@ AC_ARG_WITH([jemalloc],
|
|||||||
|
|
||||||
AC_ARG_WITH([spdylay],
|
AC_ARG_WITH([spdylay],
|
||||||
[AS_HELP_STRING([--with-spdylay],
|
[AS_HELP_STRING([--with-spdylay],
|
||||||
[Use spdylay [default=check]])],
|
[Use spdylay [default=no]])],
|
||||||
[request_spdylay=$withval], [request_spdylay=check])
|
[request_spdylay=$withval], [request_spdylay=no])
|
||||||
|
|
||||||
|
AC_ARG_WITH([systemd],
|
||||||
|
[AS_HELP_STRING([--with-systemd],
|
||||||
|
[Enable systemd support in nghttpx [default=check]])],
|
||||||
|
[request_systemd=$withval], [request_systemd=check])
|
||||||
|
|
||||||
AC_ARG_WITH([mruby],
|
AC_ARG_WITH([mruby],
|
||||||
[AS_HELP_STRING([--with-mruby],
|
[AS_HELP_STRING([--with-mruby],
|
||||||
@@ -171,19 +176,9 @@ else
|
|||||||
AC_SUBST([CYTHON])
|
AC_SUBST([CYTHON])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
|
||||||
# If we're running GCC or clang define _U_ to be "__attribute__((unused))"
|
|
||||||
# so we can use _U_ to flag unused function parameters and not get warnings
|
|
||||||
# about them. Otherwise, define _U_ to be an empty string so that _U_ used
|
|
||||||
# to flag an unused function parameters will compile with other compilers.
|
|
||||||
#
|
|
||||||
# XXX - similar hints for other compilers?
|
|
||||||
#
|
|
||||||
if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
|
if test "x$GCC" = "xyes" -o "x$CC" = "xclang" ; then
|
||||||
AC_DEFINE([_U_], [__attribute__((unused))], [Hint to the compiler that a function parameters is not used])
|
|
||||||
AC_DEFINE([NGHTTP2_NORETURN], [__attribute__((noreturn))], [Hint to the compiler that a function never return])
|
AC_DEFINE([NGHTTP2_NORETURN], [__attribute__((noreturn))], [Hint to the compiler that a function never return])
|
||||||
else
|
else
|
||||||
AC_DEFINE([_U_], , [Hint to the compiler that a function parameter is not used])
|
|
||||||
AC_DEFINE([NGHTTP2_NORETURN], , [Hint to the compiler that a function never return])
|
AC_DEFINE([NGHTTP2_NORETURN], , [Hint to the compiler that a function never return])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -370,6 +365,13 @@ if test "x${have_openssl}" = "xno"; then
|
|||||||
AC_MSG_NOTICE($OPENSSL_PKG_ERRORS)
|
AC_MSG_NOTICE($OPENSSL_PKG_ERRORS)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# c-ares (for src)
|
||||||
|
PKG_CHECK_MODULES([LIBCARES], [libcares >= 1.7.5], [have_libcares=yes],
|
||||||
|
[have_libcares=no])
|
||||||
|
if test "x${have_libcares}" = "xno"; then
|
||||||
|
AC_MSG_NOTICE($LIBCARES_PKG_ERRORS)
|
||||||
|
fi
|
||||||
|
|
||||||
# libevent_openssl (for examples)
|
# libevent_openssl (for examples)
|
||||||
# 2.0.8 is required because we use evconnlistener_set_error_cb()
|
# 2.0.8 is required because we use evconnlistener_set_error_cb()
|
||||||
PKG_CHECK_MODULES([LIBEVENT_OPENSSL], [libevent_openssl >= 2.0.8],
|
PKG_CHECK_MODULES([LIBEVENT_OPENSSL], [libevent_openssl >= 2.0.8],
|
||||||
@@ -388,18 +390,34 @@ else
|
|||||||
AC_MSG_NOTICE($JANSSON_PKG_ERRORS)
|
AC_MSG_NOTICE($JANSSON_PKG_ERRORS)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# libxml2 (for src/nghttp)
|
|
||||||
have_libxml2=no
|
|
||||||
if test "x${request_libxml2}" != "xno"; then
|
|
||||||
m4_ifdef([AM_PATH_XML2],
|
|
||||||
[AM_PATH_XML2(2.7.7, [have_libxml2=yes], [have_libxml2=no])],
|
|
||||||
[AC_MSG_WARN([configure was created without libxml2 detection macro; libxml2 detection is disabled])])
|
|
||||||
|
|
||||||
if test "x${have_libxml2}" = "xyes"; then
|
# libsystemd (for src/nghttpx)
|
||||||
AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have `libxml2` library.])
|
have_libsystemd=no
|
||||||
|
if test "x${request_systemd}" != "xno"; then
|
||||||
|
PKG_CHECK_MODULES([SYSTEMD], [libsystemd >= 209], [have_libsystemd=yes],
|
||||||
|
[have_libsystemd=no])
|
||||||
|
if test "x${have_libsystemd}" = "xyes"; then
|
||||||
|
AC_DEFINE([HAVE_LIBSYSTEMD], [1],
|
||||||
|
[Define to 1 if you have `libsystemd` library.])
|
||||||
|
else
|
||||||
|
AC_MSG_NOTICE($SYSTEMD_PKG_ERRORS)
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "x${request_systemd}" = "xyes" &&
|
||||||
|
test "x${have_libsystemd}" != "xyes"; then
|
||||||
|
AC_MSG_ERROR([systemd was requested (--with-systemd) but not found])
|
||||||
|
fi
|
||||||
|
|
||||||
|
# libxml2 (for src/nghttp)
|
||||||
|
PKG_CHECK_MODULES([LIBXML2], [libxml-2.0 >= 2.7.7],
|
||||||
|
[have_libxml2=yes], [have_libxml2=no])
|
||||||
|
if test "x${have_libxml2}" = "xyes"; then
|
||||||
|
AC_DEFINE([HAVE_LIBXML2], [1], [Define to 1 if you have `libxml2` library.])
|
||||||
|
else
|
||||||
|
AC_MSG_NOTICE($LIBXML2_PKG_ERRORS)
|
||||||
|
fi
|
||||||
|
|
||||||
if test "x${request_libxml2}" = "xyes" &&
|
if test "x${request_libxml2}" = "xyes" &&
|
||||||
test "x${have_libxml2}" != "xyes"; then
|
test "x${have_libxml2}" != "xyes"; then
|
||||||
AC_MSG_ERROR([libxml2 was requested (--with-libxml2) but not found])
|
AC_MSG_ERROR([libxml2 was requested (--with-libxml2) but not found])
|
||||||
@@ -479,13 +497,14 @@ if test "x${request_asio_lib}" = "xyes"; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# The nghttp, nghttpd and nghttpx under src depend on zlib, OpenSSL
|
# The nghttp, nghttpd and nghttpx under src depend on zlib, OpenSSL,
|
||||||
# and libev
|
# libev, and libc-ares.
|
||||||
enable_app=no
|
enable_app=no
|
||||||
if test "x${request_app}" != "xno" &&
|
if test "x${request_app}" != "xno" &&
|
||||||
test "x${have_zlib}" = "xyes" &&
|
test "x${have_zlib}" = "xyes" &&
|
||||||
test "x${have_openssl}" = "xyes" &&
|
test "x${have_openssl}" = "xyes" &&
|
||||||
test "x${have_libev}" = "xyes"; then
|
test "x${have_libev}" = "xyes" &&
|
||||||
|
test "x${have_libcares}" = "xyes"; then
|
||||||
enable_app=yes
|
enable_app=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -640,6 +659,26 @@ AC_SYS_LARGEFILE
|
|||||||
AC_CHECK_MEMBER([struct tm.tm_gmtoff], [have_struct_tm_tm_gmtoff=yes],
|
AC_CHECK_MEMBER([struct tm.tm_gmtoff], [have_struct_tm_tm_gmtoff=yes],
|
||||||
[have_struct_tm_tm_gmtoff=no], [[#include <time.h>]])
|
[have_struct_tm_tm_gmtoff=no], [[#include <time.h>]])
|
||||||
|
|
||||||
|
AC_CHECK_MEMBER([struct sockaddr_in.sin_len],
|
||||||
|
[AC_DEFINE([HAVE_SOCKADDR_IN_SIN_LEN],[1],
|
||||||
|
[Define to 1 if struct sockaddr_in has sin_len member.])],
|
||||||
|
[],
|
||||||
|
[[
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
]])
|
||||||
|
|
||||||
|
AC_CHECK_MEMBER([struct sockaddr_in6.sin6_len],
|
||||||
|
[AC_DEFINE([HAVE_SOCKADDR_IN6_SIN6_LEN],[1],
|
||||||
|
[Define to 1 if struct sockaddr_in6 has sin6_len member.])],
|
||||||
|
[],
|
||||||
|
[[
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
]])
|
||||||
|
|
||||||
if test "x$have_struct_tm_tm_gmtoff" = "xyes"; then
|
if test "x$have_struct_tm_tm_gmtoff" = "xyes"; then
|
||||||
AC_DEFINE([HAVE_STRUCT_TM_TM_GMTOFF], [1],
|
AC_DEFINE([HAVE_STRUCT_TM_TM_GMTOFF], [1],
|
||||||
[Define to 1 if you have `struct tm.tm_gmtoff` member.])
|
[Define to 1 if you have `struct tm.tm_gmtoff` member.])
|
||||||
@@ -701,13 +740,6 @@ AC_CHECK_DECLS([initgroups], [], [], [[
|
|||||||
#include <grp.h>
|
#include <grp.h>
|
||||||
]])
|
]])
|
||||||
|
|
||||||
# Checks for epoll availability, primarily for examples/tiny-nghttpd
|
|
||||||
AX_HAVE_EPOLL([have_epoll=yes], [have_epoll=no])
|
|
||||||
|
|
||||||
AM_CONDITIONAL([ENABLE_TINY_NGHTTPD],
|
|
||||||
[ test "x${have_epoll}" = "xyes" &&
|
|
||||||
test "x${have_timerfd_create}" = "xyes"])
|
|
||||||
|
|
||||||
save_CFLAGS=$CFLAGS
|
save_CFLAGS=$CFLAGS
|
||||||
save_CXXFLAGS=$CXXFLAGS
|
save_CXXFLAGS=$CXXFLAGS
|
||||||
|
|
||||||
@@ -888,13 +920,15 @@ AC_MSG_NOTICE([summary of build options:
|
|||||||
Failmalloc: ${enable_failmalloc}
|
Failmalloc: ${enable_failmalloc}
|
||||||
Libs:
|
Libs:
|
||||||
OpenSSL: ${have_openssl} (CFLAGS='${OPENSSL_CFLAGS}' LIBS='${OPENSSL_LIBS}')
|
OpenSSL: ${have_openssl} (CFLAGS='${OPENSSL_CFLAGS}' LIBS='${OPENSSL_LIBS}')
|
||||||
Libxml2: ${have_libxml2} (CFLAGS='${XML_CPPFLAGS}' LIBS='${XML_LIBS}')
|
Libxml2: ${have_libxml2} (CFLAGS='${LIBXML2_CPPFLAGS}' LIBS='${LIBXML2_LIBS}')
|
||||||
Libev: ${have_libev} (CFLAGS='${LIBEV_CFLAGS}' LIBS='${LIBEV_LIBS}')
|
Libev: ${have_libev} (CFLAGS='${LIBEV_CFLAGS}' LIBS='${LIBEV_LIBS}')
|
||||||
|
Libc-ares ${have_libcares} (CFLAGS='${LIBCARES_CFLAGS}' LIBS='${LIBCARES_LIBS}')
|
||||||
Libevent(SSL): ${have_libevent_openssl} (CFLAGS='${LIBEVENT_OPENSSL_CFLAGS}' LIBS='${LIBEVENT_OPENSSL_LIBS}')
|
Libevent(SSL): ${have_libevent_openssl} (CFLAGS='${LIBEVENT_OPENSSL_CFLAGS}' LIBS='${LIBEVENT_OPENSSL_LIBS}')
|
||||||
Spdylay: ${have_spdylay} (CFLAGS='${LIBSPDYLAY_CFLAGS}' LIBS='${LIBSPDYLAY_LIBS}')
|
Spdylay: ${have_spdylay} (CFLAGS='${LIBSPDYLAY_CFLAGS}' LIBS='${LIBSPDYLAY_LIBS}')
|
||||||
Jansson: ${have_jansson} (CFLAGS='${JANSSON_CFLAGS}' LIBS='${JANSSON_LIBS}')
|
Jansson: ${have_jansson} (CFLAGS='${JANSSON_CFLAGS}' LIBS='${JANSSON_LIBS}')
|
||||||
Jemalloc: ${have_jemalloc} (LIBS='${JEMALLOC_LIBS}')
|
Jemalloc: ${have_jemalloc} (LIBS='${JEMALLOC_LIBS}')
|
||||||
Zlib: ${have_zlib} (CFLAGS='${ZLIB_CFLAGS}' LIBS='${ZLIB_LIBS}')
|
Zlib: ${have_zlib} (CFLAGS='${ZLIB_CFLAGS}' LIBS='${ZLIB_LIBS}')
|
||||||
|
Systemd: ${have_libsystemd} (CFLAGS='${SYSTEMD_CFLAGS}' LIBS='${SYSTEMD_LIBS}')
|
||||||
Boost CPPFLAGS: ${BOOST_CPPFLAGS}
|
Boost CPPFLAGS: ${BOOST_CPPFLAGS}
|
||||||
Boost LDFLAGS: ${BOOST_LDFLAGS}
|
Boost LDFLAGS: ${BOOST_LDFLAGS}
|
||||||
Boost::ASIO: ${BOOST_ASIO_LIB}
|
Boost::ASIO: ${BOOST_ASIO_LIB}
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=HTTP/2 proxy
|
Description=HTTP/2 proxy
|
||||||
|
Documentation=man:nghttpx
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=notify
|
||||||
ExecStart=@bindir@/nghttpx --conf=/etc/nghttpx/nghttpx.conf --pid-file=/run/nghttpx.pid --daemon
|
ExecStart=@bindir@/nghttpx --conf=/etc/nghttpx/nghttpx.conf
|
||||||
|
ExecReload=/bin/kill --signal HUP $MAINPID
|
||||||
|
KillSignal=SIGQUIT
|
||||||
|
PrivateTmp=yes
|
||||||
|
ProtectHome=yes
|
||||||
|
ProtectSystem=full
|
||||||
|
Restart=always
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ APIDOCS= \
|
|||||||
nghttp2_option_set_max_send_header_block_length.rst \
|
nghttp2_option_set_max_send_header_block_length.rst \
|
||||||
nghttp2_option_set_no_auto_ping_ack.rst \
|
nghttp2_option_set_no_auto_ping_ack.rst \
|
||||||
nghttp2_option_set_no_auto_window_update.rst \
|
nghttp2_option_set_no_auto_window_update.rst \
|
||||||
|
nghttp2_option_set_no_closed_streams.rst \
|
||||||
nghttp2_option_set_no_http_messaging.rst \
|
nghttp2_option_set_no_http_messaging.rst \
|
||||||
nghttp2_option_set_no_recv_client_magic.rst \
|
nghttp2_option_set_no_recv_client_magic.rst \
|
||||||
nghttp2_option_set_peer_max_concurrent_streams.rst \
|
nghttp2_option_set_peer_max_concurrent_streams.rst \
|
||||||
@@ -266,7 +267,7 @@ apiref.rst: \
|
|||||||
$(APIDOCS): apiref.rst
|
$(APIDOCS): apiref.rst
|
||||||
|
|
||||||
clean-local:
|
clean-local:
|
||||||
[ $(srcdir) = $(builddir) ] || for i in $(RST_FILES); do [ -e $(builddir)/$$i ] && rm $(builddir)/$$i; done
|
[ $(srcdir) = $(builddir) ] || for i in $(RST_FILES); do [ -e $(builddir)/$$i ] && rm -f $(builddir)/$$i; done
|
||||||
-rm -f apiref.rst
|
-rm -f apiref.rst
|
||||||
-rm -f $(APIDOCS)
|
-rm -f $(APIDOCS)
|
||||||
-rm -rf $(BUILDDIR)/*
|
-rm -rf $(BUILDDIR)/*
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ _nghttpx()
|
|||||||
_get_comp_words_by_ref cur prev
|
_get_comp_words_by_ref cur prev
|
||||||
case $cur in
|
case $cur in
|
||||||
-*)
|
-*)
|
||||||
COMPREPLY=( $( compgen -W '--worker-read-rate --include --frontend-http2-dump-response-header --tls-ticket-key-file --verify-client-cacert --max-response-header-fields --backend-http2-window-size --backend-request-buffer --max-request-header-fields --fastopen --tls-ticket-key-memcached --conf --backend-http2-max-concurrent-streams --worker-write-burst --npn-list --fetch-ocsp-response-file --no-via --tls-session-cache-memcached-cert-file --no-http2-cipher-black-list --mruby-file --stream-read-timeout --backend-connect-timeout --forwarded-for --accesslog-syslog --frontend-http2-read-timeout --listener-disable-timeout --ciphers --strip-incoming-x-forwarded-for --no-server-rewrite --private-key-passwd-file --backend-keep-alive-timeout --backend-http-proxy-uri --rlimit-nofile --tls-ticket-key-memcached-cert-file --ocsp-update-interval --forwarded-by --tls-session-cache-memcached-private-key-file --error-page --backend-write-timeout --tls-dyn-rec-warmup-threshold --tls-ticket-key-memcached-max-retry --frontend-http2-window-size --http2-no-cookie-crumbling --worker-read-burst --dh-param-file --accesslog-format --errorlog-syslog --request-header-field-buffer --api-max-request-body --frontend-http2-decoder-dynamic-table-size --errorlog-file --frontend-http2-max-concurrent-streams --frontend-write-timeout --tls-ticket-key-cipher --read-burst --backend --server-name --insecure --backend-max-backoff --log-level --host-rewrite --tls-proto-list --tls-ticket-key-memcached-interval --frontend-http2-setting-timeout --frontend-http2-connection-window-size --worker-frontend-connections --syslog-facility --no-server-push --no-location-rewrite --tls-session-cache-memcached --no-ocsp --frontend-http2-encoder-dynamic-table-size --workers --add-forwarded --worker-write-rate --add-request-header --backend-http2-settings-timeout --subcert --ecdh-curves --no-kqueue --help --frontend-frame-debug --tls-sct-dir --pid-file --frontend-http2-dump-request-header --daemon --write-rate --altsvc --backend-http2-decoder-dynamic-table-size --user --add-x-forwarded-for --frontend-read-timeout --tls-ticket-key-memcached-max-fail --backlog --write-burst --backend-connections-per-host --response-header-field-buffer --tls-ticket-key-memcached-address-family --padding --tls-session-cache-memcached-address-family --stream-write-timeout --cacert --tls-ticket-key-memcached-private-key-file --backend-address-family --backend-http2-connection-window-size --version --add-response-header --backend-read-timeout --frontend-http2-optimize-window-size --frontend --accesslog-file --http2-proxy --backend-http2-encoder-dynamic-table-size --client-private-key-file --client-cert-file --accept-proxy-protocol --tls-dyn-rec-idle-timeout --frontend-http2-optimize-write-buffer-size --verify-client --backend-response-buffer --read-rate --backend-connections-per-frontend --strip-incoming-forwarded ' -- "$cur" ) )
|
COMPREPLY=( $( compgen -W '--worker-read-rate --include --frontend-http2-dump-response-header --tls-ticket-key-file --verify-client-cacert --max-response-header-fields --backend-http2-window-size --frontend-keep-alive-timeout --backend-request-buffer --max-request-header-fields --fastopen --backend-connect-timeout --tls-max-proto-version --conf --dns-lookup-timeout --backend-http2-max-concurrent-streams --worker-write-burst --npn-list --dns-max-try --fetch-ocsp-response-file --no-via --tls-session-cache-memcached-cert-file --no-http2-cipher-black-list --mruby-file --client-no-http2-cipher-black-list --stream-read-timeout --client-ciphers --forwarded-for --accesslog-syslog --dns-cache-timeout --frontend-http2-read-timeout --listener-disable-timeout --ciphers --client-psk-secrets --strip-incoming-x-forwarded-for --no-server-rewrite --private-key-passwd-file --backend-keep-alive-timeout --backend-http-proxy-uri --frontend-max-requests --rlimit-nofile --tls-ticket-key-memcached-cert-file --ocsp-update-interval --forwarded-by --tls-session-cache-memcached-private-key-file --error-page --backend-write-timeout --tls-dyn-rec-warmup-threshold --tls-ticket-key-memcached-max-retry --frontend-http2-window-size --http2-no-cookie-crumbling --worker-read-burst --dh-param-file --accesslog-format --errorlog-syslog --redirect-https-port --request-header-field-buffer --api-max-request-body --frontend-http2-decoder-dynamic-table-size --errorlog-file --frontend-http2-max-concurrent-streams --psk-secrets --frontend-write-timeout --tls-ticket-key-cipher --read-burst --backend --server-name --insecure --backend-max-backoff --log-level --host-rewrite --tls-ticket-key-memcached-interval --frontend-http2-setting-timeout --frontend-http2-connection-window-size --worker-frontend-connections --syslog-facility --no-server-push --no-location-rewrite --single-thread --tls-session-cache-memcached --no-ocsp --backend-response-buffer --tls-min-proto-version --workers --add-forwarded --worker-write-rate --add-request-header --backend-http2-settings-timeout --subcert --ecdh-curves --no-kqueue --help --frontend-frame-debug --tls-sct-dir --pid-file --frontend-http2-dump-request-header --daemon --write-rate --altsvc --backend-http2-decoder-dynamic-table-size --user --add-x-forwarded-for --frontend-read-timeout --tls-ticket-key-memcached-max-fail --backlog --write-burst --backend-connections-per-host --response-header-field-buffer --tls-ticket-key-memcached-address-family --padding --tls-session-cache-memcached-address-family --stream-write-timeout --cacert --tls-ticket-key-memcached-private-key-file --accesslog-write-early --backend-address-family --backend-http2-connection-window-size --version --add-response-header --backend-read-timeout --frontend-http2-optimize-window-size --frontend --accesslog-file --http2-proxy --backend-http2-encoder-dynamic-table-size --client-private-key-file --client-cert-file --tls-ticket-key-memcached --tls-dyn-rec-idle-timeout --frontend-http2-optimize-write-buffer-size --verify-client --frontend-http2-encoder-dynamic-table-size --read-rate --backend-connections-per-frontend --strip-incoming-forwarded ' -- "$cur" ) )
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
_filedir
|
_filedir
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.\" Man page generated from reStructuredText.
|
.\" Man page generated from reStructuredText.
|
||||||
.
|
.
|
||||||
.TH "H2LOAD" "1" "Oct 24, 2016" "1.16.0" "nghttp2"
|
.TH "H2LOAD" "1" "Apr 09, 2017" "1.21.1" "nghttp2"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
h2load \- HTTP/2 benchmarking tool
|
h2load \- HTTP/2 benchmarking tool
|
||||||
.
|
.
|
||||||
@@ -123,13 +123,15 @@ Add/Override a header to the requests.
|
|||||||
.B \-\-ciphers=<SUITE>
|
.B \-\-ciphers=<SUITE>
|
||||||
Set allowed cipher list. The format of the string is
|
Set allowed cipher list. The format of the string is
|
||||||
described in OpenSSL ciphers(1).
|
described in OpenSSL ciphers(1).
|
||||||
|
.sp
|
||||||
|
Default: \fBECDHE\-ECDSA\-AES256\-GCM\-SHA384:ECDHE\-RSA\-AES256\-GCM\-SHA384:ECDHE\-ECDSA\-CHACHA20\-POLY1305:ECDHE\-RSA\-CHACHA20\-POLY1305:ECDHE\-ECDSA\-AES128\-GCM\-SHA256:ECDHE\-RSA\-AES128\-GCM\-SHA256:ECDHE\-ECDSA\-AES256\-SHA384:ECDHE\-RSA\-AES256\-SHA384:ECDHE\-ECDSA\-AES128\-SHA256:ECDHE\-RSA\-AES128\-SHA256\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
.B \-p, \-\-no\-tls\-proto=<PROTOID>
|
.B \-p, \-\-no\-tls\-proto=<PROTOID>
|
||||||
Specify ALPN identifier of the protocol to be used when
|
Specify ALPN identifier of the protocol to be used when
|
||||||
accessing http URI without SSL/TLS.
|
accessing http URI without SSL/TLS.
|
||||||
Available protocols: spdy/2, spdy/3, spdy/3.1, h2c and
|
Available protocols: h2c and
|
||||||
http/1.1
|
http/1.1
|
||||||
.sp
|
.sp
|
||||||
Default: \fBh2c\fP
|
Default: \fBh2c\fP
|
||||||
@@ -231,7 +233,7 @@ NPN. The parameter must be delimited by a single comma
|
|||||||
only and any white spaces are treated as a part of
|
only and any white spaces are treated as a part of
|
||||||
protocol string.
|
protocol string.
|
||||||
.sp
|
.sp
|
||||||
Default: \fBh2,h2\-16,h2\-14,spdy/3.1,spdy/3,spdy/2,http/1.1\fP
|
Default: \fBh2,h2\-16,h2\-14,http/1.1\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
|
|||||||
@@ -96,11 +96,13 @@ OPTIONS
|
|||||||
Set allowed cipher list. The format of the string is
|
Set allowed cipher list. The format of the string is
|
||||||
described in OpenSSL ciphers(1).
|
described in OpenSSL ciphers(1).
|
||||||
|
|
||||||
|
Default: ``ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256``
|
||||||
|
|
||||||
.. option:: -p, --no-tls-proto=<PROTOID>
|
.. option:: -p, --no-tls-proto=<PROTOID>
|
||||||
|
|
||||||
Specify ALPN identifier of the protocol to be used when
|
Specify ALPN identifier of the protocol to be used when
|
||||||
accessing http URI without SSL/TLS.
|
accessing http URI without SSL/TLS.
|
||||||
Available protocols: spdy/2, spdy/3, spdy/3.1, h2c and
|
Available protocols: h2c and
|
||||||
http/1.1
|
http/1.1
|
||||||
|
|
||||||
Default: ``h2c``
|
Default: ``h2c``
|
||||||
@@ -194,7 +196,7 @@ OPTIONS
|
|||||||
only and any white spaces are treated as a part of
|
only and any white spaces are treated as a part of
|
||||||
protocol string.
|
protocol string.
|
||||||
|
|
||||||
Default: ``h2,h2-16,h2-14,spdy/3.1,spdy/3,spdy/2,http/1.1``
|
Default: ``h2,h2-16,h2-14,http/1.1``
|
||||||
|
|
||||||
.. option:: --h1
|
.. option:: --h1
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.\" Man page generated from reStructuredText.
|
.\" Man page generated from reStructuredText.
|
||||||
.
|
.
|
||||||
.TH "NGHTTP" "1" "Oct 24, 2016" "1.16.0" "nghttp2"
|
.TH "NGHTTP" "1" "Apr 09, 2017" "1.21.1" "nghttp2"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
nghttp \- HTTP/2 client
|
nghttp \- HTTP/2 client
|
||||||
.
|
.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.\" Man page generated from reStructuredText.
|
.\" Man page generated from reStructuredText.
|
||||||
.
|
.
|
||||||
.TH "NGHTTPD" "1" "Oct 24, 2016" "1.16.0" "nghttp2"
|
.TH "NGHTTPD" "1" "Apr 09, 2017" "1.21.1" "nghttp2"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
nghttpd \- HTTP/2 server
|
nghttpd \- HTTP/2 server
|
||||||
.
|
.
|
||||||
|
|||||||
341
doc/nghttpx.1
341
doc/nghttpx.1
@@ -1,6 +1,6 @@
|
|||||||
.\" Man page generated from reStructuredText.
|
.\" Man page generated from reStructuredText.
|
||||||
.
|
.
|
||||||
.TH "NGHTTPX" "1" "Oct 24, 2016" "1.16.0" "nghttp2"
|
.TH "NGHTTPX" "1" "Apr 09, 2017" "1.21.1" "nghttp2"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
nghttpx \- HTTP/2 proxy
|
nghttpx \- HTTP/2 proxy
|
||||||
.
|
.
|
||||||
@@ -62,8 +62,7 @@ domain socket can be specified by prefixing path name
|
|||||||
with "unix:" (e.g., unix:/var/run/backend.sock).
|
with "unix:" (e.g., unix:/var/run/backend.sock).
|
||||||
.sp
|
.sp
|
||||||
Optionally, if <PATTERN>s are given, the backend address
|
Optionally, if <PATTERN>s are given, the backend address
|
||||||
is only used if request matches the pattern. If
|
is only used if request matches the pattern. The
|
||||||
\fI\%\-\-http2\-proxy\fP is used, <PATTERN>s are ignored. The
|
|
||||||
pattern matching is closely designed to ServeMux in
|
pattern matching is closely designed to ServeMux in
|
||||||
net/http package of Go programming language. <PATTERN>
|
net/http package of Go programming language. <PATTERN>
|
||||||
consists of path, host + path or just host. The path
|
consists of path, host + path or just host. The path
|
||||||
@@ -78,7 +77,10 @@ If host is given, it performs exact match against the
|
|||||||
request host. If host alone is given, "\fI/\fP" is appended
|
request host. If host alone is given, "\fI/\fP" is appended
|
||||||
to it, so that it matches all request paths under the
|
to it, so that it matches all request paths under the
|
||||||
host (e.g., specifying "nghttp2.org" equals to
|
host (e.g., specifying "nghttp2.org" equals to
|
||||||
"nghttp2.org/").
|
"nghttp2.org/"). CONNECT method is treated specially.
|
||||||
|
It does not have path, and we don\(aqt allow empty path.
|
||||||
|
To workaround this, we assume that CONNECT method has
|
||||||
|
"\fI/\fP" as path.
|
||||||
.sp
|
.sp
|
||||||
Patterns with host take precedence over patterns with
|
Patterns with host take precedence over patterns with
|
||||||
just path. Then, longer patterns take precedence over
|
just path. Then, longer patterns take precedence over
|
||||||
@@ -120,13 +122,13 @@ together forming load balancing group.
|
|||||||
Several parameters <PARAM> are accepted after <PATTERN>.
|
Several parameters <PARAM> are accepted after <PATTERN>.
|
||||||
The parameters are delimited by ";". The available
|
The parameters are delimited by ";". The available
|
||||||
parameters are: "proto=<PROTO>", "tls",
|
parameters are: "proto=<PROTO>", "tls",
|
||||||
"sni=<SNI_HOST>", "fall=<N>", "rise=<N>", and
|
"sni=<SNI_HOST>", "fall=<N>", "rise=<N>",
|
||||||
"affinity=<METHOD>". The parameter consists of keyword,
|
"affinity=<METHOD>", "dns", and "redirect\-if\-not\-tls".
|
||||||
and optionally followed by "=" and value. For example,
|
The parameter consists of keyword, and optionally
|
||||||
the parameter "proto=h2" consists of the keyword "proto"
|
followed by "=" and value. For example, the parameter
|
||||||
and value "h2". The parameter "tls" consists of the
|
"proto=h2" consists of the keyword "proto" and value
|
||||||
keyword "tls" without value. Each parameter is
|
"h2". The parameter "tls" consists of the keyword "tls"
|
||||||
described as follows.
|
without value. Each parameter is described as follows.
|
||||||
.sp
|
.sp
|
||||||
The backend application protocol can be specified using
|
The backend application protocol can be specified using
|
||||||
optional "proto" parameter, and in the form of
|
optional "proto" parameter, and in the form of
|
||||||
@@ -175,6 +177,27 @@ session affinity is desired. The session affinity may
|
|||||||
break if one of the backend gets unreachable, or backend
|
break if one of the backend gets unreachable, or backend
|
||||||
settings are reloaded or replaced by API.
|
settings are reloaded or replaced by API.
|
||||||
.sp
|
.sp
|
||||||
|
By default, name resolution of backend host name is done
|
||||||
|
at start up, or reloading configuration. If "dns"
|
||||||
|
parameter is given, name resolution takes place
|
||||||
|
dynamically. This is useful if backend address changes
|
||||||
|
frequently. If "dns" is given, name resolution of
|
||||||
|
backend host name at start up, or reloading
|
||||||
|
configuration is skipped.
|
||||||
|
.sp
|
||||||
|
If "redirect\-if\-not\-tls" parameter is used, the matched
|
||||||
|
backend requires that frontend connection is TLS
|
||||||
|
encrypted. If it isn\(aqt, nghttpx responds to the request
|
||||||
|
with 308 status code, and https URI the client should
|
||||||
|
use instead is included in Location header field. The
|
||||||
|
port number in redirect URI is 443 by default, and can
|
||||||
|
be changed using \fI\%\-\-redirect\-https\-port\fP option. If at
|
||||||
|
least one backend has "redirect\-if\-not\-tls" parameter,
|
||||||
|
this feature is enabled for all backend servers sharing
|
||||||
|
the same <PATTERN>. It is advised to set
|
||||||
|
"redirect\-if\-no\-tls" parameter to all backends
|
||||||
|
explicitly if this feature is desired.
|
||||||
|
.sp
|
||||||
Since ";" and ":" are used as delimiter, <PATTERN> must
|
Since ";" and ":" are used as delimiter, <PATTERN> must
|
||||||
not contain these characters. Since ";" has special
|
not contain these characters. Since ";" has special
|
||||||
meaning in shell, the option value must be quoted.
|
meaning in shell, the option value must be quoted.
|
||||||
@@ -210,6 +233,10 @@ specify "healthmon" parameter. This is disabled by
|
|||||||
default. Any requests which come through this address
|
default. Any requests which come through this address
|
||||||
are replied with 200 HTTP status, without no body.
|
are replied with 200 HTTP status, without no body.
|
||||||
.sp
|
.sp
|
||||||
|
To accept PROXY protocol version 1 on frontend
|
||||||
|
connection, specify "proxyproto" parameter. This is
|
||||||
|
disabled by default.
|
||||||
|
.sp
|
||||||
Default: \fB*,3000\fP
|
Default: \fB*,3000\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
@@ -217,7 +244,7 @@ Default: \fB*,3000\fP
|
|||||||
.B \-\-backlog=<N>
|
.B \-\-backlog=<N>
|
||||||
Set listen backlog size.
|
Set listen backlog size.
|
||||||
.sp
|
.sp
|
||||||
Default: \fB512\fP
|
Default: \fB65536\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -245,11 +272,6 @@ timeouts when connecting and making CONNECT request can
|
|||||||
be specified by \fI\%\-\-backend\-read\-timeout\fP and
|
be specified by \fI\%\-\-backend\-read\-timeout\fP and
|
||||||
\fI\%\-\-backend\-write\-timeout\fP options.
|
\fI\%\-\-backend\-write\-timeout\fP options.
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
|
||||||
.TP
|
|
||||||
.B \-\-accept\-proxy\-protocol
|
|
||||||
Accept PROXY protocol version 1 on frontend connection.
|
|
||||||
.UNINDENT
|
|
||||||
.SS Performance
|
.SS Performance
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -260,6 +282,15 @@ Default: \fB1\fP
|
|||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
|
.B \-\-single\-thread
|
||||||
|
Run everything in one thread inside the worker process.
|
||||||
|
This feature is provided for better debugging
|
||||||
|
experience, or for the platforms which lack thread
|
||||||
|
support. If threading is disabled, this option is
|
||||||
|
always enabled.
|
||||||
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
.B \-\-read\-rate=<SIZE>
|
.B \-\-read\-rate=<SIZE>
|
||||||
Set maximum average read rate on frontend connection.
|
Set maximum average read rate on frontend connection.
|
||||||
Setting 0 to this option means read rate is unlimited.
|
Setting 0 to this option means read rate is unlimited.
|
||||||
@@ -426,6 +457,14 @@ Default: \fB30s\fP
|
|||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
|
.B \-\-frontend\-keep\-alive\-timeout=<DURATION>
|
||||||
|
Specify keep\-alive timeout for frontend HTTP/1
|
||||||
|
connection.
|
||||||
|
.sp
|
||||||
|
Default: \fB1m\fP
|
||||||
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
.B \-\-stream\-read\-timeout=<DURATION>
|
.B \-\-stream\-read\-timeout=<DURATION>
|
||||||
Specify read timeout for HTTP/2 and SPDY streams. 0
|
Specify read timeout for HTTP/2 and SPDY streams. 0
|
||||||
means no timeout.
|
means no timeout.
|
||||||
@@ -438,7 +477,7 @@ Default: \fB0\fP
|
|||||||
Specify write timeout for HTTP/2 and SPDY streams. 0
|
Specify write timeout for HTTP/2 and SPDY streams. 0
|
||||||
means no timeout.
|
means no timeout.
|
||||||
.sp
|
.sp
|
||||||
Default: \fB0\fP
|
Default: \fB1m\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -465,7 +504,8 @@ Default: \fB30s\fP
|
|||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
.B \-\-backend\-keep\-alive\-timeout=<DURATION>
|
.B \-\-backend\-keep\-alive\-timeout=<DURATION>
|
||||||
Specify keep\-alive timeout for backend connection.
|
Specify keep\-alive timeout for backend HTTP/1
|
||||||
|
connection.
|
||||||
.sp
|
.sp
|
||||||
Default: \fB2s\fP
|
Default: \fB2s\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
@@ -512,8 +552,18 @@ Default: \fB2m\fP
|
|||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
.B \-\-ciphers=<SUITE>
|
.B \-\-ciphers=<SUITE>
|
||||||
Set allowed cipher list. The format of the string is
|
Set allowed cipher list for frontend connection. The
|
||||||
described in OpenSSL ciphers(1).
|
format of the string is described in OpenSSL ciphers(1).
|
||||||
|
.sp
|
||||||
|
Default: \fBECDHE\-ECDSA\-AES256\-GCM\-SHA384:ECDHE\-RSA\-AES256\-GCM\-SHA384:ECDHE\-ECDSA\-CHACHA20\-POLY1305:ECDHE\-RSA\-CHACHA20\-POLY1305:ECDHE\-ECDSA\-AES128\-GCM\-SHA256:ECDHE\-RSA\-AES128\-GCM\-SHA256:ECDHE\-ECDSA\-AES256\-SHA384:ECDHE\-RSA\-AES256\-SHA384:ECDHE\-ECDSA\-AES128\-SHA256:ECDHE\-RSA\-AES128\-SHA256\fP
|
||||||
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
|
.B \-\-client\-ciphers=<SUITE>
|
||||||
|
Set allowed cipher list for backend connection. The
|
||||||
|
format of the string is described in OpenSSL ciphers(1).
|
||||||
|
.sp
|
||||||
|
Default: \fBECDHE\-ECDSA\-AES256\-GCM\-SHA384:ECDHE\-RSA\-AES256\-GCM\-SHA384:ECDHE\-ECDSA\-CHACHA20\-POLY1305:ECDHE\-RSA\-CHACHA20\-POLY1305:ECDHE\-ECDSA\-AES128\-GCM\-SHA256:ECDHE\-RSA\-AES128\-GCM\-SHA256:ECDHE\-ECDSA\-AES256\-SHA384:ECDHE\-RSA\-AES256\-SHA384:ECDHE\-ECDSA\-AES128\-SHA256:ECDHE\-RSA\-AES128\-SHA256\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -524,7 +574,7 @@ in the preference order. The supported curves depend on
|
|||||||
the linked OpenSSL library. This function requires
|
the linked OpenSSL library. This function requires
|
||||||
OpenSSL >= 1.0.2.
|
OpenSSL >= 1.0.2.
|
||||||
.sp
|
.sp
|
||||||
Default: \fBP\-256:P\-384:P\-521\fP
|
Default: \fBX25519:P\-256:P\-384:P\-521\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -553,9 +603,14 @@ password protected it\(aqll be requested interactively.
|
|||||||
.B \-\-subcert=<KEYPATH>:<CERTPATH>[[;<PARAM>]...]
|
.B \-\-subcert=<KEYPATH>:<CERTPATH>[[;<PARAM>]...]
|
||||||
Specify additional certificate and private key file.
|
Specify additional certificate and private key file.
|
||||||
nghttpx will choose certificates based on the hostname
|
nghttpx will choose certificates based on the hostname
|
||||||
indicated by client using TLS SNI extension. This
|
indicated by client using TLS SNI extension. If nghttpx
|
||||||
option can be used multiple times. To make OCSP
|
is built with OpenSSL >= 1.0.2, signature algorithms
|
||||||
stapling work, <CERTPATH> must be absolute path.
|
(e.g., ECDSA+SHA256, RSA+SHA256) presented by client are
|
||||||
|
also taken into consideration. This allows nghttpx to
|
||||||
|
send ECDSA certificate to modern clients, while sending
|
||||||
|
RSA based certificate to older clients. This option can
|
||||||
|
be used multiple times. To make OCSP stapling work,
|
||||||
|
<CERTPATH> must be absolute path.
|
||||||
.sp
|
.sp
|
||||||
Additional parameter can be specified in <PARAM>. The
|
Additional parameter can be specified in <PARAM>. The
|
||||||
available <PARAM> is "sct\-dir=<DIR>".
|
available <PARAM> is "sct\-dir=<DIR>".
|
||||||
@@ -583,7 +638,7 @@ NPN. The parameter must be delimited by a single comma
|
|||||||
only and any white spaces are treated as a part of
|
only and any white spaces are treated as a part of
|
||||||
protocol string.
|
protocol string.
|
||||||
.sp
|
.sp
|
||||||
Default: \fBh2,h2\-16,h2\-14,spdy/3.1,http/1.1\fP
|
Default: \fBh2,h2\-16,h2\-14,http/1.1\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -611,18 +666,29 @@ backend client authentication.
|
|||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
.B \-\-tls\-proto\-list=<LIST>
|
.B \-\-tls\-min\-proto\-version=<VER>
|
||||||
Comma delimited list of SSL/TLS protocol to be enabled.
|
Specify minimum SSL/TLS protocol. The name matching is
|
||||||
The following protocols are available: TLSv1.2, TLSv1.1
|
done in case\-insensitive manner. The versions between
|
||||||
and TLSv1.0. The name matching is done in
|
\fI\%\-\-tls\-min\-proto\-version\fP and \fI\%\-\-tls\-max\-proto\-version\fP are
|
||||||
case\-insensitive manner. The parameter must be
|
enabled. If the protocol list advertised by client does
|
||||||
delimited by a single comma only and any white spaces
|
not overlap this range, you will receive the error
|
||||||
are treated as a part of protocol string. If the
|
message "unknown protocol". The available versions are:
|
||||||
protocol list advertised by client does not overlap this
|
TLSv1.2, TLSv1.1, and TLSv1.0
|
||||||
list, you will receive the error message "unknown
|
|
||||||
protocol".
|
|
||||||
.sp
|
.sp
|
||||||
Default: \fBTLSv1.2,TLSv1.1\fP
|
Default: \fBTLSv1.1\fP
|
||||||
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
|
.B \-\-tls\-max\-proto\-version=<VER>
|
||||||
|
Specify maximum SSL/TLS protocol. The name matching is
|
||||||
|
done in case\-insensitive manner. The versions between
|
||||||
|
\fI\%\-\-tls\-min\-proto\-version\fP and \fI\%\-\-tls\-max\-proto\-version\fP are
|
||||||
|
enabled. If the protocol list advertised by client does
|
||||||
|
not overlap this range, you will receive the error
|
||||||
|
message "unknown protocol". The available versions are:
|
||||||
|
TLSv1.2, TLSv1.1, and TLSv1.0
|
||||||
|
.sp
|
||||||
|
Default: \fBTLSv1.2\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -803,9 +869,18 @@ Default: \fB1s\fP
|
|||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
.B \-\-no\-http2\-cipher\-black\-list
|
.B \-\-no\-http2\-cipher\-black\-list
|
||||||
Allow black listed cipher suite on HTTP/2 connection.
|
Allow black listed cipher suite on frontend HTTP/2
|
||||||
See \fI\%https://tools.ietf.org/html/rfc7540#appendix\-A\fP for
|
connection. See
|
||||||
the complete HTTP/2 cipher suites black list.
|
\fI\%https://tools.ietf.org/html/rfc7540#appendix\-A\fP for the
|
||||||
|
complete HTTP/2 cipher suites black list.
|
||||||
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
|
.B \-\-client\-no\-http2\-cipher\-black\-list
|
||||||
|
Allow black listed cipher suite on backend HTTP/2
|
||||||
|
connection. See
|
||||||
|
\fI\%https://tools.ietf.org/html/rfc7540#appendix\-A\fP for the
|
||||||
|
complete HTTP/2 cipher suites black list.
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -819,6 +894,39 @@ argument <CERT>, or certificate option in configuration
|
|||||||
file. For additional certificates, use \fI\%\-\-subcert\fP
|
file. For additional certificates, use \fI\%\-\-subcert\fP
|
||||||
option. This option requires OpenSSL >= 1.0.2.
|
option. This option requires OpenSSL >= 1.0.2.
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
|
.B \-\-psk\-secrets=<PATH>
|
||||||
|
Read list of PSK identity and secrets from <PATH>. This
|
||||||
|
is used for frontend connection. The each line of input
|
||||||
|
file is formatted as <identity>:<hex\-secret>, where
|
||||||
|
<identity> is PSK identity, and <hex\-secret> is secret
|
||||||
|
in hex. An empty line, and line which starts with \(aq#\(aq
|
||||||
|
are skipped. The default enabled cipher list might not
|
||||||
|
contain any PSK cipher suite. In that case, desired PSK
|
||||||
|
cipher suites must be enabled using \fI\%\-\-ciphers\fP option.
|
||||||
|
The desired PSK cipher suite may be black listed by
|
||||||
|
HTTP/2. To use those cipher suites with HTTP/2,
|
||||||
|
consider to use \fI\%\-\-no\-http2\-cipher\-black\-list\fP option.
|
||||||
|
But be aware its implications.
|
||||||
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
|
.B \-\-client\-psk\-secrets=<PATH>
|
||||||
|
Read PSK identity and secrets from <PATH>. This is used
|
||||||
|
for backend connection. The each line of input file is
|
||||||
|
formatted as <identity>:<hex\-secret>, where <identity>
|
||||||
|
is PSK identity, and <hex\-secret> is secret in hex. An
|
||||||
|
empty line, and line which starts with \(aq#\(aq are skipped.
|
||||||
|
The first identity and secret pair encountered is used.
|
||||||
|
The default enabled cipher list might not contain any
|
||||||
|
PSK cipher suite. In that case, desired PSK cipher
|
||||||
|
suites must be enabled using \fI\%\-\-client\-ciphers\fP option.
|
||||||
|
The desired PSK cipher suite may be black listed by
|
||||||
|
HTTP/2. To use those cipher suites with HTTP/2,
|
||||||
|
consider to use \fI\%\-\-client\-no\-http2\-cipher\-black\-list\fP
|
||||||
|
option. But be aware its implications.
|
||||||
|
.UNINDENT
|
||||||
.SS HTTP/2 and SPDY
|
.SS HTTP/2 and SPDY
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -1057,6 +1165,13 @@ Default: \fB$remote_addr \- \- [$time_local] "$request" $status $body_bytes_sent
|
|||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
|
.B \-\-accesslog\-write\-early
|
||||||
|
Write access log when response header fields are
|
||||||
|
received from backend rather than when request
|
||||||
|
transaction finishes.
|
||||||
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
.B \-\-errorlog\-file=<PATH>
|
.B \-\-errorlog\-file=<PATH>
|
||||||
Set path to write error log. To reopen file, send USR1
|
Set path to write error log. To reopen file, send USR1
|
||||||
signal to nghttpx. stderr will be redirected to the
|
signal to nghttpx. stderr will be redirected to the
|
||||||
@@ -1238,7 +1353,7 @@ backend server, the custom error pages are not used.
|
|||||||
.B \-\-server\-name=<NAME>
|
.B \-\-server\-name=<NAME>
|
||||||
Change server response header field value to <NAME>.
|
Change server response header field value to <NAME>.
|
||||||
.sp
|
.sp
|
||||||
Default: \fBnghttpx nghttp2/1.16.0\fP
|
Default: \fBnghttpx\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -1247,6 +1362,15 @@ Don\(aqt rewrite server header field in default mode. When
|
|||||||
\fI\%\-\-http2\-proxy\fP is used, these headers will not be altered
|
\fI\%\-\-http2\-proxy\fP is used, these headers will not be altered
|
||||||
regardless of this option.
|
regardless of this option.
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
|
.B \-\-redirect\-https\-port=<PORT>
|
||||||
|
Specify the port number which appears in Location header
|
||||||
|
field when redirect to HTTPS URI is made due to
|
||||||
|
"redirect\-if\-not\-tls" parameter in \fI\%\-\-backend\fP option.
|
||||||
|
.sp
|
||||||
|
Default: \fB443\fP
|
||||||
|
.UNINDENT
|
||||||
.SS API
|
.SS API
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -1255,6 +1379,43 @@ Set the maximum size of request body for API request.
|
|||||||
.sp
|
.sp
|
||||||
Default: \fB16K\fP
|
Default: \fB16K\fP
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
|
.SS DNS
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
|
.B \-\-dns\-cache\-timeout=<DURATION>
|
||||||
|
Set duration that cached DNS results remain valid. Note
|
||||||
|
that nghttpx caches the unsuccessful results as well.
|
||||||
|
.sp
|
||||||
|
Default: \fB10s\fP
|
||||||
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
|
.B \-\-dns\-lookup\-timeout=<DURATION>
|
||||||
|
Set timeout that DNS server is given to respond to the
|
||||||
|
initial DNS query. For the 2nd and later queries,
|
||||||
|
server is given time based on this timeout, and it is
|
||||||
|
scaled linearly.
|
||||||
|
.sp
|
||||||
|
Default: \fB5s\fP
|
||||||
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
|
.B \-\-dns\-max\-try=<N>
|
||||||
|
Set the number of DNS query before nghttpx gives up name
|
||||||
|
lookup.
|
||||||
|
.sp
|
||||||
|
Default: \fB2\fP
|
||||||
|
.UNINDENT
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
|
.B \-\-frontend\-max\-requests=<N>
|
||||||
|
The number of requests that single frontend connection
|
||||||
|
can process. For HTTP/2, this is the number of streams
|
||||||
|
in one HTTP/2 connection. For HTTP/1, this is the
|
||||||
|
number of keep alive requests. This is hint to nghttpx,
|
||||||
|
and it may allow additional few requests. The default
|
||||||
|
value is unlimited.
|
||||||
|
.UNINDENT
|
||||||
.SS Debug
|
.SS Debug
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
.TP
|
.TP
|
||||||
@@ -1393,6 +1554,35 @@ positional arguments in command\-line, use \fBprivate\-key\-file\fP and
|
|||||||
.sp
|
.sp
|
||||||
\fI\%\-\-conf\fP option cannot be used in the configuration file and
|
\fI\%\-\-conf\fP option cannot be used in the configuration file and
|
||||||
will be ignored if specified.
|
will be ignored if specified.
|
||||||
|
.TP
|
||||||
|
.B Error log
|
||||||
|
Error log is written to stderr by default. It can be configured
|
||||||
|
using \fI\%\-\-errorlog\-file\fP\&. The format of log message is as
|
||||||
|
follows:
|
||||||
|
.sp
|
||||||
|
<datetime> <master\-pid> <current\-pid> <thread\-id> <level> (<filename>:<line>) <msg>
|
||||||
|
.INDENT 7.0
|
||||||
|
.TP
|
||||||
|
.B <datetime>
|
||||||
|
It is a conbination of date and time when the log is written. It
|
||||||
|
is in ISO 8601 format.
|
||||||
|
.TP
|
||||||
|
.B <master\-pid>
|
||||||
|
It is a master process ID.
|
||||||
|
.TP
|
||||||
|
.B <current\-pid>
|
||||||
|
It is a process ID which writes this log.
|
||||||
|
.TP
|
||||||
|
.B <thread\-id>
|
||||||
|
It is a thread ID which writes this log. It would be unique
|
||||||
|
within <current\-pid>.
|
||||||
|
.TP
|
||||||
|
.B <filename> and <line>
|
||||||
|
They are source file name, and line number which produce this log.
|
||||||
|
.TP
|
||||||
|
.B <msg>
|
||||||
|
It is a log message body.
|
||||||
|
.UNINDENT
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.SH SIGNALS
|
.SH SIGNALS
|
||||||
.INDENT 0.0
|
.INDENT 0.0
|
||||||
@@ -1407,16 +1597,23 @@ Reload configuration file given in \fI\%\-\-conf\fP\&.
|
|||||||
.TP
|
.TP
|
||||||
.B SIGUSR1
|
.B SIGUSR1
|
||||||
Reopen log files.
|
Reopen log files.
|
||||||
.TP
|
.UNINDENT
|
||||||
.B SIGUSR2
|
.sp
|
||||||
|
SIGUSR2
|
||||||
|
.INDENT 0.0
|
||||||
|
.INDENT 3.5
|
||||||
Fork and execute nghttpx. It will execute the binary in the same
|
Fork and execute nghttpx. It will execute the binary in the same
|
||||||
path with same command\-line arguments and environment variables.
|
path with same command\-line arguments and environment variables. As
|
||||||
After new process comes up, sending SIGQUIT to the original process
|
of nghttpx version 1.20.0, the new master process sends SIGQUIT to
|
||||||
to perform hot swapping. The difference between SIGUSR2 + SIGQUIT
|
the original master process when it is ready to serve requests. For
|
||||||
and SIGHUP is that former is usually used to execute new binary, and
|
the earlier versions of nghttpx, user has to send SIGQUIT to the
|
||||||
the master process is newly spawned. On the other hand, the latter
|
original master process.
|
||||||
just reloads configuration file, and the same master process
|
.sp
|
||||||
continues to exist.
|
The difference between SIGUSR2 (+ SIGQUIT) and SIGHUP is that former
|
||||||
|
is usually used to execute new binary, and the master process is
|
||||||
|
newly spawned. On the other hand, the latter just reloads
|
||||||
|
configuration file, and the same master process continues to exist.
|
||||||
|
.UNINDENT
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.sp
|
.sp
|
||||||
\fBNOTE:\fP
|
\fBNOTE:\fP
|
||||||
@@ -1837,6 +2034,19 @@ completely custom header fields, first call
|
|||||||
existing header fields, and then add required header fields.
|
existing header fields, and then add required header fields.
|
||||||
It is an error to call this method twice for a given request.
|
It is an error to call this method twice for a given request.
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
|
.INDENT 7.0
|
||||||
|
.TP
|
||||||
|
.B send_info(status, headers)
|
||||||
|
Send non\-final (informational) response to a client. \fIstatus\fP
|
||||||
|
must be in the range [100, 199], inclusive. \fIheaders\fP is a
|
||||||
|
hash containing response header fields. Its key must be a
|
||||||
|
string, and the associated value must be either string or
|
||||||
|
array of strings. Since this is not a final response, even if
|
||||||
|
this method is invoked, request is still forwarded to a
|
||||||
|
backend unless \fI\%Nghttpx::Response#return\fP is called.
|
||||||
|
This method can be called multiple times. It cannot be called
|
||||||
|
after \fI\%Nghttpx::Response#return\fP is called.
|
||||||
|
.UNINDENT
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.SS MRUBY EXAMPLES
|
.SS MRUBY EXAMPLES
|
||||||
.sp
|
.sp
|
||||||
@@ -1912,15 +2122,18 @@ The request was failed. No change has been made.
|
|||||||
HTTP status code
|
HTTP status code
|
||||||
.UNINDENT
|
.UNINDENT
|
||||||
.sp
|
.sp
|
||||||
|
Additionally, depending on the API endpoint, \fBdata\fP key may be
|
||||||
|
present, and its value contains the API endpoint specific data.
|
||||||
|
.sp
|
||||||
We wrote "normally", since nghttpx may return ordinal HTML response in
|
We wrote "normally", since nghttpx may return ordinal HTML response in
|
||||||
some cases where the error has occurred before reaching API endpoint
|
some cases where the error has occurred before reaching API endpoint
|
||||||
(e.g., header field is too large).
|
(e.g., header field is too large).
|
||||||
.sp
|
.sp
|
||||||
The following section describes available API endpoints.
|
The following section describes available API endpoints.
|
||||||
.SS PUT /api/v1beta1/backendconfig
|
.SS POST /api/v1beta1/backendconfig
|
||||||
.sp
|
.sp
|
||||||
This API replaces the current backend server settings with the
|
This API replaces the current backend server settings with the
|
||||||
requested ones. The request method should be PUT, but POST is also
|
requested ones. The request method should be POST, but PUT is also
|
||||||
acceptable. The request body must be nghttpx configuration file
|
acceptable. The request body must be nghttpx configuration file
|
||||||
format. For configuration file format, see \fI\%FILES\fP section. The
|
format. For configuration file format, see \fI\%FILES\fP section. The
|
||||||
line separator inside the request body must be single LF (0x0A).
|
line separator inside the request body must be single LF (0x0A).
|
||||||
@@ -1936,9 +2149,27 @@ connections or requests. It also avoids any process creation as is
|
|||||||
the case with hot swapping with signals.
|
the case with hot swapping with signals.
|
||||||
.sp
|
.sp
|
||||||
The one limitation is that only numeric IP address is allowd in
|
The one limitation is that only numeric IP address is allowd in
|
||||||
\fI\%backend\fP in request body while non numeric
|
\fI\%backend\fP in request body unless "dns" parameter
|
||||||
hostname is allowed in command\-line or configuration file is read
|
is used while non numeric hostname is allowed in command\-line or
|
||||||
using \fI\%\-\-conf\fP\&.
|
configuration file is read using \fI\%\-\-conf\fP\&.
|
||||||
|
.SS GET /api/v1beta1/configrevision
|
||||||
|
.sp
|
||||||
|
This API returns configuration revision of the current nghttpx. The
|
||||||
|
configuration revision is opaque string, and it changes after each
|
||||||
|
reloading by SIGHUP. With this API, an external application knows
|
||||||
|
that whether nghttpx has finished reloading its configuration by
|
||||||
|
comparing the configuration revisions between before and after
|
||||||
|
reloading. It is recommended to disable persistent (keep\-alive)
|
||||||
|
connection for this purpose in order to avoid to send a request using
|
||||||
|
the reused connection which may bound to an old process.
|
||||||
|
.sp
|
||||||
|
This API returns response including \fBdata\fP key. Its value is JSON
|
||||||
|
object, and it contains at least the following key:
|
||||||
|
.INDENT 0.0
|
||||||
|
.TP
|
||||||
|
.B configRevision
|
||||||
|
The configuration revision of the current nghttpx
|
||||||
|
.UNINDENT
|
||||||
.SH SEE ALSO
|
.SH SEE ALSO
|
||||||
.sp
|
.sp
|
||||||
\fBnghttp(1)\fP, \fBnghttpd(1)\fP, \fBh2load(1)\fP
|
\fBnghttp(1)\fP, \fBnghttpd(1)\fP, \fBh2load(1)\fP
|
||||||
|
|||||||
@@ -46,8 +46,7 @@ Connections
|
|||||||
with "unix:" (e.g., unix:/var/run/backend.sock).
|
with "unix:" (e.g., unix:/var/run/backend.sock).
|
||||||
|
|
||||||
Optionally, if <PATTERN>s are given, the backend address
|
Optionally, if <PATTERN>s are given, the backend address
|
||||||
is only used if request matches the pattern. If
|
is only used if request matches the pattern. The
|
||||||
:option:`--http2-proxy` is used, <PATTERN>s are ignored. The
|
|
||||||
pattern matching is closely designed to ServeMux in
|
pattern matching is closely designed to ServeMux in
|
||||||
net/http package of Go programming language. <PATTERN>
|
net/http package of Go programming language. <PATTERN>
|
||||||
consists of path, host + path or just host. The path
|
consists of path, host + path or just host. The path
|
||||||
@@ -62,7 +61,10 @@ Connections
|
|||||||
request host. If host alone is given, "*/*" is appended
|
request host. If host alone is given, "*/*" is appended
|
||||||
to it, so that it matches all request paths under the
|
to it, so that it matches all request paths under the
|
||||||
host (e.g., specifying "nghttp2.org" equals to
|
host (e.g., specifying "nghttp2.org" equals to
|
||||||
"nghttp2.org/").
|
"nghttp2.org/"). CONNECT method is treated specially.
|
||||||
|
It does not have path, and we don't allow empty path.
|
||||||
|
To workaround this, we assume that CONNECT method has
|
||||||
|
"*/*" as path.
|
||||||
|
|
||||||
Patterns with host take precedence over patterns with
|
Patterns with host take precedence over patterns with
|
||||||
just path. Then, longer patterns take precedence over
|
just path. Then, longer patterns take precedence over
|
||||||
@@ -104,13 +106,13 @@ Connections
|
|||||||
Several parameters <PARAM> are accepted after <PATTERN>.
|
Several parameters <PARAM> are accepted after <PATTERN>.
|
||||||
The parameters are delimited by ";". The available
|
The parameters are delimited by ";". The available
|
||||||
parameters are: "proto=<PROTO>", "tls",
|
parameters are: "proto=<PROTO>", "tls",
|
||||||
"sni=<SNI_HOST>", "fall=<N>", "rise=<N>", and
|
"sni=<SNI_HOST>", "fall=<N>", "rise=<N>",
|
||||||
"affinity=<METHOD>". The parameter consists of keyword,
|
"affinity=<METHOD>", "dns", and "redirect-if-not-tls".
|
||||||
and optionally followed by "=" and value. For example,
|
The parameter consists of keyword, and optionally
|
||||||
the parameter "proto=h2" consists of the keyword "proto"
|
followed by "=" and value. For example, the parameter
|
||||||
and value "h2". The parameter "tls" consists of the
|
"proto=h2" consists of the keyword "proto" and value
|
||||||
keyword "tls" without value. Each parameter is
|
"h2". The parameter "tls" consists of the keyword "tls"
|
||||||
described as follows.
|
without value. Each parameter is described as follows.
|
||||||
|
|
||||||
The backend application protocol can be specified using
|
The backend application protocol can be specified using
|
||||||
optional "proto" parameter, and in the form of
|
optional "proto" parameter, and in the form of
|
||||||
@@ -159,6 +161,27 @@ Connections
|
|||||||
break if one of the backend gets unreachable, or backend
|
break if one of the backend gets unreachable, or backend
|
||||||
settings are reloaded or replaced by API.
|
settings are reloaded or replaced by API.
|
||||||
|
|
||||||
|
By default, name resolution of backend host name is done
|
||||||
|
at start up, or reloading configuration. If "dns"
|
||||||
|
parameter is given, name resolution takes place
|
||||||
|
dynamically. This is useful if backend address changes
|
||||||
|
frequently. If "dns" is given, name resolution of
|
||||||
|
backend host name at start up, or reloading
|
||||||
|
configuration is skipped.
|
||||||
|
|
||||||
|
If "redirect-if-not-tls" parameter is used, the matched
|
||||||
|
backend requires that frontend connection is TLS
|
||||||
|
encrypted. If it isn't, nghttpx responds to the request
|
||||||
|
with 308 status code, and https URI the client should
|
||||||
|
use instead is included in Location header field. The
|
||||||
|
port number in redirect URI is 443 by default, and can
|
||||||
|
be changed using :option:`--redirect-https-port` option. If at
|
||||||
|
least one backend has "redirect-if-not-tls" parameter,
|
||||||
|
this feature is enabled for all backend servers sharing
|
||||||
|
the same <PATTERN>. It is advised to set
|
||||||
|
"redirect-if-no-tls" parameter to all backends
|
||||||
|
explicitly if this feature is desired.
|
||||||
|
|
||||||
Since ";" and ":" are used as delimiter, <PATTERN> must
|
Since ";" and ":" are used as delimiter, <PATTERN> must
|
||||||
not contain these characters. Since ";" has special
|
not contain these characters. Since ";" has special
|
||||||
meaning in shell, the option value must be quoted.
|
meaning in shell, the option value must be quoted.
|
||||||
@@ -194,6 +217,10 @@ Connections
|
|||||||
default. Any requests which come through this address
|
default. Any requests which come through this address
|
||||||
are replied with 200 HTTP status, without no body.
|
are replied with 200 HTTP status, without no body.
|
||||||
|
|
||||||
|
To accept PROXY protocol version 1 on frontend
|
||||||
|
connection, specify "proxyproto" parameter. This is
|
||||||
|
disabled by default.
|
||||||
|
|
||||||
|
|
||||||
Default: ``*,3000``
|
Default: ``*,3000``
|
||||||
|
|
||||||
@@ -201,7 +228,7 @@ Connections
|
|||||||
|
|
||||||
Set listen backlog size.
|
Set listen backlog size.
|
||||||
|
|
||||||
Default: ``512``
|
Default: ``65536``
|
||||||
|
|
||||||
.. option:: --backend-address-family=(auto|IPv4|IPv6)
|
.. option:: --backend-address-family=(auto|IPv4|IPv6)
|
||||||
|
|
||||||
@@ -227,10 +254,6 @@ Connections
|
|||||||
be specified by :option:`--backend-read-timeout` and
|
be specified by :option:`--backend-read-timeout` and
|
||||||
:option:`--backend-write-timeout` options.
|
:option:`--backend-write-timeout` options.
|
||||||
|
|
||||||
.. option:: --accept-proxy-protocol
|
|
||||||
|
|
||||||
Accept PROXY protocol version 1 on frontend connection.
|
|
||||||
|
|
||||||
|
|
||||||
Performance
|
Performance
|
||||||
~~~~~~~~~~~
|
~~~~~~~~~~~
|
||||||
@@ -241,6 +264,14 @@ Performance
|
|||||||
|
|
||||||
Default: ``1``
|
Default: ``1``
|
||||||
|
|
||||||
|
.. option:: --single-thread
|
||||||
|
|
||||||
|
Run everything in one thread inside the worker process.
|
||||||
|
This feature is provided for better debugging
|
||||||
|
experience, or for the platforms which lack thread
|
||||||
|
support. If threading is disabled, this option is
|
||||||
|
always enabled.
|
||||||
|
|
||||||
.. option:: --read-rate=<SIZE>
|
.. option:: --read-rate=<SIZE>
|
||||||
|
|
||||||
Set maximum average read rate on frontend connection.
|
Set maximum average read rate on frontend connection.
|
||||||
@@ -391,6 +422,13 @@ Timeout
|
|||||||
|
|
||||||
Default: ``30s``
|
Default: ``30s``
|
||||||
|
|
||||||
|
.. option:: --frontend-keep-alive-timeout=<DURATION>
|
||||||
|
|
||||||
|
Specify keep-alive timeout for frontend HTTP/1
|
||||||
|
connection.
|
||||||
|
|
||||||
|
Default: ``1m``
|
||||||
|
|
||||||
.. option:: --stream-read-timeout=<DURATION>
|
.. option:: --stream-read-timeout=<DURATION>
|
||||||
|
|
||||||
Specify read timeout for HTTP/2 and SPDY streams. 0
|
Specify read timeout for HTTP/2 and SPDY streams. 0
|
||||||
@@ -403,7 +441,7 @@ Timeout
|
|||||||
Specify write timeout for HTTP/2 and SPDY streams. 0
|
Specify write timeout for HTTP/2 and SPDY streams. 0
|
||||||
means no timeout.
|
means no timeout.
|
||||||
|
|
||||||
Default: ``0``
|
Default: ``1m``
|
||||||
|
|
||||||
.. option:: --backend-read-timeout=<DURATION>
|
.. option:: --backend-read-timeout=<DURATION>
|
||||||
|
|
||||||
@@ -426,7 +464,8 @@ Timeout
|
|||||||
|
|
||||||
.. option:: --backend-keep-alive-timeout=<DURATION>
|
.. option:: --backend-keep-alive-timeout=<DURATION>
|
||||||
|
|
||||||
Specify keep-alive timeout for backend connection.
|
Specify keep-alive timeout for backend HTTP/1
|
||||||
|
connection.
|
||||||
|
|
||||||
Default: ``2s``
|
Default: ``2s``
|
||||||
|
|
||||||
@@ -471,8 +510,17 @@ SSL/TLS
|
|||||||
|
|
||||||
.. option:: --ciphers=<SUITE>
|
.. option:: --ciphers=<SUITE>
|
||||||
|
|
||||||
Set allowed cipher list. The format of the string is
|
Set allowed cipher list for frontend connection. The
|
||||||
described in OpenSSL ciphers(1).
|
format of the string is described in OpenSSL ciphers(1).
|
||||||
|
|
||||||
|
Default: ``ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256``
|
||||||
|
|
||||||
|
.. option:: --client-ciphers=<SUITE>
|
||||||
|
|
||||||
|
Set allowed cipher list for backend connection. The
|
||||||
|
format of the string is described in OpenSSL ciphers(1).
|
||||||
|
|
||||||
|
Default: ``ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256``
|
||||||
|
|
||||||
.. option:: --ecdh-curves=<LIST>
|
.. option:: --ecdh-curves=<LIST>
|
||||||
|
|
||||||
@@ -482,7 +530,7 @@ SSL/TLS
|
|||||||
the linked OpenSSL library. This function requires
|
the linked OpenSSL library. This function requires
|
||||||
OpenSSL >= 1.0.2.
|
OpenSSL >= 1.0.2.
|
||||||
|
|
||||||
Default: ``P-256:P-384:P-521``
|
Default: ``X25519:P-256:P-384:P-521``
|
||||||
|
|
||||||
.. option:: -k, --insecure
|
.. option:: -k, --insecure
|
||||||
|
|
||||||
@@ -507,9 +555,14 @@ SSL/TLS
|
|||||||
|
|
||||||
Specify additional certificate and private key file.
|
Specify additional certificate and private key file.
|
||||||
nghttpx will choose certificates based on the hostname
|
nghttpx will choose certificates based on the hostname
|
||||||
indicated by client using TLS SNI extension. This
|
indicated by client using TLS SNI extension. If nghttpx
|
||||||
option can be used multiple times. To make OCSP
|
is built with OpenSSL >= 1.0.2, signature algorithms
|
||||||
stapling work, <CERTPATH> must be absolute path.
|
(e.g., ECDSA+SHA256, RSA+SHA256) presented by client are
|
||||||
|
also taken into consideration. This allows nghttpx to
|
||||||
|
send ECDSA certificate to modern clients, while sending
|
||||||
|
RSA based certificate to older clients. This option can
|
||||||
|
be used multiple times. To make OCSP stapling work,
|
||||||
|
<CERTPATH> must be absolute path.
|
||||||
|
|
||||||
Additional parameter can be specified in <PARAM>. The
|
Additional parameter can be specified in <PARAM>. The
|
||||||
available <PARAM> is "sct-dir=<DIR>".
|
available <PARAM> is "sct-dir=<DIR>".
|
||||||
@@ -535,7 +588,7 @@ SSL/TLS
|
|||||||
only and any white spaces are treated as a part of
|
only and any white spaces are treated as a part of
|
||||||
protocol string.
|
protocol string.
|
||||||
|
|
||||||
Default: ``h2,h2-16,h2-14,spdy/3.1,http/1.1``
|
Default: ``h2,h2-16,h2-14,http/1.1``
|
||||||
|
|
||||||
.. option:: --verify-client
|
.. option:: --verify-client
|
||||||
|
|
||||||
@@ -557,19 +610,29 @@ SSL/TLS
|
|||||||
Path to file that contains client certificate used in
|
Path to file that contains client certificate used in
|
||||||
backend client authentication.
|
backend client authentication.
|
||||||
|
|
||||||
.. option:: --tls-proto-list=<LIST>
|
.. option:: --tls-min-proto-version=<VER>
|
||||||
|
|
||||||
Comma delimited list of SSL/TLS protocol to be enabled.
|
Specify minimum SSL/TLS protocol. The name matching is
|
||||||
The following protocols are available: TLSv1.2, TLSv1.1
|
done in case-insensitive manner. The versions between
|
||||||
and TLSv1.0. The name matching is done in
|
:option:`--tls-min-proto-version` and :option:`\--tls-max-proto-version` are
|
||||||
case-insensitive manner. The parameter must be
|
enabled. If the protocol list advertised by client does
|
||||||
delimited by a single comma only and any white spaces
|
not overlap this range, you will receive the error
|
||||||
are treated as a part of protocol string. If the
|
message "unknown protocol". The available versions are:
|
||||||
protocol list advertised by client does not overlap this
|
TLSv1.2, TLSv1.1, and TLSv1.0
|
||||||
list, you will receive the error message "unknown
|
|
||||||
protocol".
|
|
||||||
|
|
||||||
Default: ``TLSv1.2,TLSv1.1``
|
Default: ``TLSv1.1``
|
||||||
|
|
||||||
|
.. option:: --tls-max-proto-version=<VER>
|
||||||
|
|
||||||
|
Specify maximum SSL/TLS protocol. The name matching is
|
||||||
|
done in case-insensitive manner. The versions between
|
||||||
|
:option:`--tls-min-proto-version` and :option:`\--tls-max-proto-version` are
|
||||||
|
enabled. If the protocol list advertised by client does
|
||||||
|
not overlap this range, you will receive the error
|
||||||
|
message "unknown protocol". The available versions are:
|
||||||
|
TLSv1.2, TLSv1.1, and TLSv1.0
|
||||||
|
|
||||||
|
Default: ``TLSv1.2``
|
||||||
|
|
||||||
.. option:: --tls-ticket-key-file=<PATH>
|
.. option:: --tls-ticket-key-file=<PATH>
|
||||||
|
|
||||||
@@ -731,9 +794,17 @@ SSL/TLS
|
|||||||
|
|
||||||
.. option:: --no-http2-cipher-black-list
|
.. option:: --no-http2-cipher-black-list
|
||||||
|
|
||||||
Allow black listed cipher suite on HTTP/2 connection.
|
Allow black listed cipher suite on frontend HTTP/2
|
||||||
See https://tools.ietf.org/html/rfc7540#appendix-A for
|
connection. See
|
||||||
the complete HTTP/2 cipher suites black list.
|
https://tools.ietf.org/html/rfc7540#appendix-A for the
|
||||||
|
complete HTTP/2 cipher suites black list.
|
||||||
|
|
||||||
|
.. option:: --client-no-http2-cipher-black-list
|
||||||
|
|
||||||
|
Allow black listed cipher suite on backend HTTP/2
|
||||||
|
connection. See
|
||||||
|
https://tools.ietf.org/html/rfc7540#appendix-A for the
|
||||||
|
complete HTTP/2 cipher suites black list.
|
||||||
|
|
||||||
.. option:: --tls-sct-dir=<DIR>
|
.. option:: --tls-sct-dir=<DIR>
|
||||||
|
|
||||||
@@ -746,6 +817,37 @@ SSL/TLS
|
|||||||
file. For additional certificates, use :option:`--subcert`
|
file. For additional certificates, use :option:`--subcert`
|
||||||
option. This option requires OpenSSL >= 1.0.2.
|
option. This option requires OpenSSL >= 1.0.2.
|
||||||
|
|
||||||
|
.. option:: --psk-secrets=<PATH>
|
||||||
|
|
||||||
|
Read list of PSK identity and secrets from <PATH>. This
|
||||||
|
is used for frontend connection. The each line of input
|
||||||
|
file is formatted as <identity>:<hex-secret>, where
|
||||||
|
<identity> is PSK identity, and <hex-secret> is secret
|
||||||
|
in hex. An empty line, and line which starts with '#'
|
||||||
|
are skipped. The default enabled cipher list might not
|
||||||
|
contain any PSK cipher suite. In that case, desired PSK
|
||||||
|
cipher suites must be enabled using :option:`--ciphers` option.
|
||||||
|
The desired PSK cipher suite may be black listed by
|
||||||
|
HTTP/2. To use those cipher suites with HTTP/2,
|
||||||
|
consider to use :option:`--no-http2-cipher-black-list` option.
|
||||||
|
But be aware its implications.
|
||||||
|
|
||||||
|
.. option:: --client-psk-secrets=<PATH>
|
||||||
|
|
||||||
|
Read PSK identity and secrets from <PATH>. This is used
|
||||||
|
for backend connection. The each line of input file is
|
||||||
|
formatted as <identity>:<hex-secret>, where <identity>
|
||||||
|
is PSK identity, and <hex-secret> is secret in hex. An
|
||||||
|
empty line, and line which starts with '#' are skipped.
|
||||||
|
The first identity and secret pair encountered is used.
|
||||||
|
The default enabled cipher list might not contain any
|
||||||
|
PSK cipher suite. In that case, desired PSK cipher
|
||||||
|
suites must be enabled using :option:`--client-ciphers` option.
|
||||||
|
The desired PSK cipher suite may be black listed by
|
||||||
|
HTTP/2. To use those cipher suites with HTTP/2,
|
||||||
|
consider to use :option:`--client-no-http2-cipher-black-list`
|
||||||
|
option. But be aware its implications.
|
||||||
|
|
||||||
|
|
||||||
HTTP/2 and SPDY
|
HTTP/2 and SPDY
|
||||||
~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~
|
||||||
@@ -953,6 +1055,12 @@ Logging
|
|||||||
|
|
||||||
Default: ``$remote_addr - - [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"``
|
Default: ``$remote_addr - - [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"``
|
||||||
|
|
||||||
|
.. option:: --accesslog-write-early
|
||||||
|
|
||||||
|
Write access log when response header fields are
|
||||||
|
received from backend rather than when request
|
||||||
|
transaction finishes.
|
||||||
|
|
||||||
.. option:: --errorlog-file=<PATH>
|
.. option:: --errorlog-file=<PATH>
|
||||||
|
|
||||||
Set path to write error log. To reopen file, send USR1
|
Set path to write error log. To reopen file, send USR1
|
||||||
@@ -1118,7 +1226,7 @@ HTTP
|
|||||||
|
|
||||||
Change server response header field value to <NAME>.
|
Change server response header field value to <NAME>.
|
||||||
|
|
||||||
Default: ``nghttpx nghttp2/1.16.0``
|
Default: ``nghttpx``
|
||||||
|
|
||||||
.. option:: --no-server-rewrite
|
.. option:: --no-server-rewrite
|
||||||
|
|
||||||
@@ -1126,6 +1234,14 @@ HTTP
|
|||||||
:option:`--http2-proxy` is used, these headers will not be altered
|
:option:`--http2-proxy` is used, these headers will not be altered
|
||||||
regardless of this option.
|
regardless of this option.
|
||||||
|
|
||||||
|
.. option:: --redirect-https-port=<PORT>
|
||||||
|
|
||||||
|
Specify the port number which appears in Location header
|
||||||
|
field when redirect to HTTPS URI is made due to
|
||||||
|
"redirect-if-not-tls" parameter in :option:`--backend` option.
|
||||||
|
|
||||||
|
Default: ``443``
|
||||||
|
|
||||||
|
|
||||||
API
|
API
|
||||||
~~~
|
~~~
|
||||||
@@ -1137,6 +1253,42 @@ API
|
|||||||
Default: ``16K``
|
Default: ``16K``
|
||||||
|
|
||||||
|
|
||||||
|
DNS
|
||||||
|
~~~
|
||||||
|
|
||||||
|
.. option:: --dns-cache-timeout=<DURATION>
|
||||||
|
|
||||||
|
Set duration that cached DNS results remain valid. Note
|
||||||
|
that nghttpx caches the unsuccessful results as well.
|
||||||
|
|
||||||
|
Default: ``10s``
|
||||||
|
|
||||||
|
.. option:: --dns-lookup-timeout=<DURATION>
|
||||||
|
|
||||||
|
Set timeout that DNS server is given to respond to the
|
||||||
|
initial DNS query. For the 2nd and later queries,
|
||||||
|
server is given time based on this timeout, and it is
|
||||||
|
scaled linearly.
|
||||||
|
|
||||||
|
Default: ``5s``
|
||||||
|
|
||||||
|
.. option:: --dns-max-try=<N>
|
||||||
|
|
||||||
|
Set the number of DNS query before nghttpx gives up name
|
||||||
|
lookup.
|
||||||
|
|
||||||
|
Default: ``2``
|
||||||
|
|
||||||
|
.. option:: --frontend-max-requests=<N>
|
||||||
|
|
||||||
|
The number of requests that single frontend connection
|
||||||
|
can process. For HTTP/2, this is the number of streams
|
||||||
|
in one HTTP/2 connection. For HTTP/1, this is the
|
||||||
|
number of keep alive requests. This is hint to nghttpx,
|
||||||
|
and it may allow additional few requests. The default
|
||||||
|
value is unlimited.
|
||||||
|
|
||||||
|
|
||||||
Debug
|
Debug
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
@@ -1266,6 +1418,33 @@ FILES
|
|||||||
:option:`--conf` option cannot be used in the configuration file and
|
:option:`--conf` option cannot be used in the configuration file and
|
||||||
will be ignored if specified.
|
will be ignored if specified.
|
||||||
|
|
||||||
|
Error log
|
||||||
|
Error log is written to stderr by default. It can be configured
|
||||||
|
using :option:`--errorlog-file`. The format of log message is as
|
||||||
|
follows:
|
||||||
|
|
||||||
|
<datetime> <master-pid> <current-pid> <thread-id> <level> (<filename>:<line>) <msg>
|
||||||
|
|
||||||
|
<datetime>
|
||||||
|
It is a conbination of date and time when the log is written. It
|
||||||
|
is in ISO 8601 format.
|
||||||
|
|
||||||
|
<master-pid>
|
||||||
|
It is a master process ID.
|
||||||
|
|
||||||
|
<current-pid>
|
||||||
|
It is a process ID which writes this log.
|
||||||
|
|
||||||
|
<thread-id>
|
||||||
|
It is a thread ID which writes this log. It would be unique
|
||||||
|
within <current-pid>.
|
||||||
|
|
||||||
|
<filename> and <line>
|
||||||
|
They are source file name, and line number which produce this log.
|
||||||
|
|
||||||
|
<msg>
|
||||||
|
It is a log message body.
|
||||||
|
|
||||||
SIGNALS
|
SIGNALS
|
||||||
-------
|
-------
|
||||||
|
|
||||||
@@ -1281,14 +1460,18 @@ SIGUSR1
|
|||||||
Reopen log files.
|
Reopen log files.
|
||||||
|
|
||||||
SIGUSR2
|
SIGUSR2
|
||||||
|
|
||||||
Fork and execute nghttpx. It will execute the binary in the same
|
Fork and execute nghttpx. It will execute the binary in the same
|
||||||
path with same command-line arguments and environment variables.
|
path with same command-line arguments and environment variables. As
|
||||||
After new process comes up, sending SIGQUIT to the original process
|
of nghttpx version 1.20.0, the new master process sends SIGQUIT to
|
||||||
to perform hot swapping. The difference between SIGUSR2 + SIGQUIT
|
the original master process when it is ready to serve requests. For
|
||||||
and SIGHUP is that former is usually used to execute new binary, and
|
the earlier versions of nghttpx, user has to send SIGQUIT to the
|
||||||
the master process is newly spawned. On the other hand, the latter
|
original master process.
|
||||||
just reloads configuration file, and the same master process
|
|
||||||
continues to exist.
|
The difference between SIGUSR2 (+ SIGQUIT) and SIGHUP is that former
|
||||||
|
is usually used to execute new binary, and the master process is
|
||||||
|
newly spawned. On the other hand, the latter just reloads
|
||||||
|
configuration file, and the same master process continues to exist.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -1680,6 +1863,18 @@ respectively.
|
|||||||
existing header fields, and then add required header fields.
|
existing header fields, and then add required header fields.
|
||||||
It is an error to call this method twice for a given request.
|
It is an error to call this method twice for a given request.
|
||||||
|
|
||||||
|
.. rb:method:: send_info(status, headers)
|
||||||
|
|
||||||
|
Send non-final (informational) response to a client. *status*
|
||||||
|
must be in the range [100, 199], inclusive. *headers* is a
|
||||||
|
hash containing response header fields. Its key must be a
|
||||||
|
string, and the associated value must be either string or
|
||||||
|
array of strings. Since this is not a final response, even if
|
||||||
|
this method is invoked, request is still forwarded to a
|
||||||
|
backend unless :rb:meth:`Nghttpx::Response#return` is called.
|
||||||
|
This method can be called multiple times. It cannot be called
|
||||||
|
after :rb:meth:`Nghttpx::Response#return` is called.
|
||||||
|
|
||||||
MRUBY EXAMPLES
|
MRUBY EXAMPLES
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@@ -1741,17 +1936,20 @@ status
|
|||||||
code
|
code
|
||||||
HTTP status code
|
HTTP status code
|
||||||
|
|
||||||
|
Additionally, depending on the API endpoint, ``data`` key may be
|
||||||
|
present, and its value contains the API endpoint specific data.
|
||||||
|
|
||||||
We wrote "normally", since nghttpx may return ordinal HTML response in
|
We wrote "normally", since nghttpx may return ordinal HTML response in
|
||||||
some cases where the error has occurred before reaching API endpoint
|
some cases where the error has occurred before reaching API endpoint
|
||||||
(e.g., header field is too large).
|
(e.g., header field is too large).
|
||||||
|
|
||||||
The following section describes available API endpoints.
|
The following section describes available API endpoints.
|
||||||
|
|
||||||
PUT /api/v1beta1/backendconfig
|
POST /api/v1beta1/backendconfig
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This API replaces the current backend server settings with the
|
This API replaces the current backend server settings with the
|
||||||
requested ones. The request method should be PUT, but POST is also
|
requested ones. The request method should be POST, but PUT is also
|
||||||
acceptable. The request body must be nghttpx configuration file
|
acceptable. The request body must be nghttpx configuration file
|
||||||
format. For configuration file format, see `FILES`_ section. The
|
format. For configuration file format, see `FILES`_ section. The
|
||||||
line separator inside the request body must be single LF (0x0A).
|
line separator inside the request body must be single LF (0x0A).
|
||||||
@@ -1768,9 +1966,28 @@ connections or requests. It also avoids any process creation as is
|
|||||||
the case with hot swapping with signals.
|
the case with hot swapping with signals.
|
||||||
|
|
||||||
The one limitation is that only numeric IP address is allowd in
|
The one limitation is that only numeric IP address is allowd in
|
||||||
:option:`backend <--backend>` in request body while non numeric
|
:option:`backend <--backend>` in request body unless "dns" parameter
|
||||||
hostname is allowed in command-line or configuration file is read
|
is used while non numeric hostname is allowed in command-line or
|
||||||
using :option:`--conf`.
|
configuration file is read using :option:`--conf`.
|
||||||
|
|
||||||
|
GET /api/v1beta1/configrevision
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
This API returns configuration revision of the current nghttpx. The
|
||||||
|
configuration revision is opaque string, and it changes after each
|
||||||
|
reloading by SIGHUP. With this API, an external application knows
|
||||||
|
that whether nghttpx has finished reloading its configuration by
|
||||||
|
comparing the configuration revisions between before and after
|
||||||
|
reloading. It is recommended to disable persistent (keep-alive)
|
||||||
|
connection for this purpose in order to avoid to send a request using
|
||||||
|
the reused connection which may bound to an old process.
|
||||||
|
|
||||||
|
This API returns response including ``data`` key. Its value is JSON
|
||||||
|
object, and it contains at least the following key:
|
||||||
|
|
||||||
|
configRevision
|
||||||
|
The configuration revision of the current nghttpx
|
||||||
|
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
--------
|
--------
|
||||||
|
|||||||
@@ -41,6 +41,33 @@ FILES
|
|||||||
:option:`--conf` option cannot be used in the configuration file and
|
:option:`--conf` option cannot be used in the configuration file and
|
||||||
will be ignored if specified.
|
will be ignored if specified.
|
||||||
|
|
||||||
|
Error log
|
||||||
|
Error log is written to stderr by default. It can be configured
|
||||||
|
using :option:`--errorlog-file`. The format of log message is as
|
||||||
|
follows:
|
||||||
|
|
||||||
|
<datetime> <master-pid> <current-pid> <thread-id> <level> (<filename>:<line>) <msg>
|
||||||
|
|
||||||
|
<datetime>
|
||||||
|
It is a conbination of date and time when the log is written. It
|
||||||
|
is in ISO 8601 format.
|
||||||
|
|
||||||
|
<master-pid>
|
||||||
|
It is a master process ID.
|
||||||
|
|
||||||
|
<current-pid>
|
||||||
|
It is a process ID which writes this log.
|
||||||
|
|
||||||
|
<thread-id>
|
||||||
|
It is a thread ID which writes this log. It would be unique
|
||||||
|
within <current-pid>.
|
||||||
|
|
||||||
|
<filename> and <line>
|
||||||
|
They are source file name, and line number which produce this log.
|
||||||
|
|
||||||
|
<msg>
|
||||||
|
It is a log message body.
|
||||||
|
|
||||||
SIGNALS
|
SIGNALS
|
||||||
-------
|
-------
|
||||||
|
|
||||||
@@ -56,14 +83,18 @@ SIGUSR1
|
|||||||
Reopen log files.
|
Reopen log files.
|
||||||
|
|
||||||
SIGUSR2
|
SIGUSR2
|
||||||
|
|
||||||
Fork and execute nghttpx. It will execute the binary in the same
|
Fork and execute nghttpx. It will execute the binary in the same
|
||||||
path with same command-line arguments and environment variables.
|
path with same command-line arguments and environment variables. As
|
||||||
After new process comes up, sending SIGQUIT to the original process
|
of nghttpx version 1.20.0, the new master process sends SIGQUIT to
|
||||||
to perform hot swapping. The difference between SIGUSR2 + SIGQUIT
|
the original master process when it is ready to serve requests. For
|
||||||
and SIGHUP is that former is usually used to execute new binary, and
|
the earlier versions of nghttpx, user has to send SIGQUIT to the
|
||||||
the master process is newly spawned. On the other hand, the latter
|
original master process.
|
||||||
just reloads configuration file, and the same master process
|
|
||||||
continues to exist.
|
The difference between SIGUSR2 (+ SIGQUIT) and SIGHUP is that former
|
||||||
|
is usually used to execute new binary, and the master process is
|
||||||
|
newly spawned. On the other hand, the latter just reloads
|
||||||
|
configuration file, and the same master process continues to exist.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
||||||
@@ -455,6 +486,18 @@ respectively.
|
|||||||
existing header fields, and then add required header fields.
|
existing header fields, and then add required header fields.
|
||||||
It is an error to call this method twice for a given request.
|
It is an error to call this method twice for a given request.
|
||||||
|
|
||||||
|
.. rb:method:: send_info(status, headers)
|
||||||
|
|
||||||
|
Send non-final (informational) response to a client. *status*
|
||||||
|
must be in the range [100, 199], inclusive. *headers* is a
|
||||||
|
hash containing response header fields. Its key must be a
|
||||||
|
string, and the associated value must be either string or
|
||||||
|
array of strings. Since this is not a final response, even if
|
||||||
|
this method is invoked, request is still forwarded to a
|
||||||
|
backend unless :rb:meth:`Nghttpx::Response#return` is called.
|
||||||
|
This method can be called multiple times. It cannot be called
|
||||||
|
after :rb:meth:`Nghttpx::Response#return` is called.
|
||||||
|
|
||||||
MRUBY EXAMPLES
|
MRUBY EXAMPLES
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~
|
||||||
|
|
||||||
@@ -516,17 +559,20 @@ status
|
|||||||
code
|
code
|
||||||
HTTP status code
|
HTTP status code
|
||||||
|
|
||||||
|
Additionally, depending on the API endpoint, ``data`` key may be
|
||||||
|
present, and its value contains the API endpoint specific data.
|
||||||
|
|
||||||
We wrote "normally", since nghttpx may return ordinal HTML response in
|
We wrote "normally", since nghttpx may return ordinal HTML response in
|
||||||
some cases where the error has occurred before reaching API endpoint
|
some cases where the error has occurred before reaching API endpoint
|
||||||
(e.g., header field is too large).
|
(e.g., header field is too large).
|
||||||
|
|
||||||
The following section describes available API endpoints.
|
The following section describes available API endpoints.
|
||||||
|
|
||||||
PUT /api/v1beta1/backendconfig
|
POST /api/v1beta1/backendconfig
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This API replaces the current backend server settings with the
|
This API replaces the current backend server settings with the
|
||||||
requested ones. The request method should be PUT, but POST is also
|
requested ones. The request method should be POST, but PUT is also
|
||||||
acceptable. The request body must be nghttpx configuration file
|
acceptable. The request body must be nghttpx configuration file
|
||||||
format. For configuration file format, see `FILES`_ section. The
|
format. For configuration file format, see `FILES`_ section. The
|
||||||
line separator inside the request body must be single LF (0x0A).
|
line separator inside the request body must be single LF (0x0A).
|
||||||
@@ -543,9 +589,28 @@ connections or requests. It also avoids any process creation as is
|
|||||||
the case with hot swapping with signals.
|
the case with hot swapping with signals.
|
||||||
|
|
||||||
The one limitation is that only numeric IP address is allowd in
|
The one limitation is that only numeric IP address is allowd in
|
||||||
:option:`backend <--backend>` in request body while non numeric
|
:option:`backend <--backend>` in request body unless "dns" parameter
|
||||||
hostname is allowed in command-line or configuration file is read
|
is used while non numeric hostname is allowed in command-line or
|
||||||
using :option:`--conf`.
|
configuration file is read using :option:`--conf`.
|
||||||
|
|
||||||
|
GET /api/v1beta1/configrevision
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
This API returns configuration revision of the current nghttpx. The
|
||||||
|
configuration revision is opaque string, and it changes after each
|
||||||
|
reloading by SIGHUP. With this API, an external application knows
|
||||||
|
that whether nghttpx has finished reloading its configuration by
|
||||||
|
comparing the configuration revisions between before and after
|
||||||
|
reloading. It is recommended to disable persistent (keep-alive)
|
||||||
|
connection for this purpose in order to avoid to send a request using
|
||||||
|
the reused connection which may bound to an old process.
|
||||||
|
|
||||||
|
This API returns response including ``data`` key. Its value is JSON
|
||||||
|
object, and it contains at least the following key:
|
||||||
|
|
||||||
|
configRevision
|
||||||
|
The configuration revision of the current nghttpx
|
||||||
|
|
||||||
|
|
||||||
SEE ALSO
|
SEE ALSO
|
||||||
--------
|
--------
|
||||||
|
|||||||
@@ -173,6 +173,11 @@ parsed as 64 bit signed integer. The sum of data length in the
|
|||||||
following DATA frames must match with the number in "Content-Length"
|
following DATA frames must match with the number in "Content-Length"
|
||||||
header field if it is present (this does not include padding bytes).
|
header field if it is present (this does not include padding bytes).
|
||||||
|
|
||||||
|
RFC 7230 says that server must not send "Content-Length" in any
|
||||||
|
response with 1xx, and 204 status code. It also says that
|
||||||
|
"Content-Length" is not allowed in any response with 200 status code
|
||||||
|
to a CONNECT request. nghttp2 enforces them as well.
|
||||||
|
|
||||||
Any deviation results in stream error of type PROTOCOL_ERROR. If
|
Any deviation results in stream error of type PROTOCOL_ERROR. If
|
||||||
error is found in PUSH_PROMISE frame, stream error is raised against
|
error is found in PUSH_PROMISE frame, stream error is raised against
|
||||||
promised stream.
|
promised stream.
|
||||||
|
|||||||
@@ -22,24 +22,22 @@ unpacked:
|
|||||||
.. code-block:: text
|
.. code-block:: text
|
||||||
|
|
||||||
$ build/tools/make_standalone_toolchain.py \
|
$ build/tools/make_standalone_toolchain.py \
|
||||||
--arch arm --api 16 --stl gnustl
|
--arch arm --api 16 --stl gnustl \
|
||||||
--install-dir $ANDROID_HOME/toolchain
|
--install-dir $ANDROID_HOME/toolchain
|
||||||
|
|
||||||
The API level (``--api``) is not important here because we don't use
|
The API level (``--api``) is not important here because we don't use
|
||||||
Android specific C/C++ API.
|
Android specific C/C++ API.
|
||||||
|
|
||||||
The dependent libraries, such as OpenSSL and libev should be built
|
The dependent libraries, such as OpenSSL, libev, and c-ares should be
|
||||||
with the toolchain and installed under ``$ANDROID_HOME/usr/local``.
|
built with the toolchain and installed under
|
||||||
We recommend to build these libraries as static library to make the
|
``$ANDROID_HOME/usr/local``. We recommend to build these libraries as
|
||||||
deployment easier. libxml2 support is currently disabled.
|
static library to make the deployment easier. libxml2 support is
|
||||||
|
currently disabled.
|
||||||
|
|
||||||
Although zlib comes with Android NDK, it seems not to be a part of
|
Although zlib comes with Android NDK, it seems not to be a part of
|
||||||
public API, so we have to built it for our own. That also provides us
|
public API, so we have to built it for our own. That also provides us
|
||||||
proper .pc file as a bonus.
|
proper .pc file as a bonus.
|
||||||
|
|
||||||
If SPDY support is required for nghttpx and h2load, build and install
|
|
||||||
spdylay as well.
|
|
||||||
|
|
||||||
Before running ``android-config`` and ``android-make``,
|
Before running ``android-config`` and ``android-make``,
|
||||||
``ANDROID_HOME`` environment variable must be set to point to the
|
``ANDROID_HOME`` environment variable must be set to point to the
|
||||||
correct path. Also add ``$ANDROID_HOME/toolchain/bin`` to ``PATH``:
|
correct path. Also add ``$ANDROID_HOME/toolchain/bin`` to ``PATH``:
|
||||||
@@ -96,6 +94,26 @@ patch, to configure libev, use the following script:
|
|||||||
|
|
||||||
And run ``make install`` to build and install.
|
And run ``make install`` to build and install.
|
||||||
|
|
||||||
|
To configure c-ares, use the following script:
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
|
#!/bin/sh -e
|
||||||
|
|
||||||
|
if [ -z "$ANDROID_HOME" ]; then
|
||||||
|
echo 'No $ANDROID_HOME specified.'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
PREFIX=$ANDROID_HOME/usr/local
|
||||||
|
TOOLCHAIN=$ANDROID_HOME/toolchain
|
||||||
|
PATH=$TOOLCHAIN/bin:$PATH
|
||||||
|
|
||||||
|
./configure \
|
||||||
|
--host=arm-linux-androideabi \
|
||||||
|
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
|
||||||
|
--prefix=$PREFIX \
|
||||||
|
--disable-shared
|
||||||
|
|
||||||
To configure zlib, use the following script:
|
To configure zlib, use the following script:
|
||||||
|
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
@@ -125,34 +143,6 @@ To configure zlib, use the following script:
|
|||||||
|
|
||||||
And run ``make install`` to build and install.
|
And run ``make install`` to build and install.
|
||||||
|
|
||||||
To configure spdylay, use the following script:
|
|
||||||
|
|
||||||
.. code-block:: sh
|
|
||||||
|
|
||||||
#!/bin/sh -e
|
|
||||||
|
|
||||||
if [ -z "$ANDROID_HOME" ]; then
|
|
||||||
echo 'No $ANDROID_HOME specified.'
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
PREFIX=$ANDROID_HOME/usr/local
|
|
||||||
TOOLCHAIN=$ANDROID_HOME/toolchain
|
|
||||||
PATH=$TOOLCHAIN/bin:$PATH
|
|
||||||
|
|
||||||
./configure \
|
|
||||||
--disable-shared \
|
|
||||||
--host=arm-linux-androideabi \
|
|
||||||
--build=`dpkg-architecture -qDEB_BUILD_GNU_TYPE` \
|
|
||||||
--prefix=$PREFIX \
|
|
||||||
--without-libxml2 \
|
|
||||||
--disable-src \
|
|
||||||
--disable-examples \
|
|
||||||
CPPFLAGS="-I$PREFIX/include" \
|
|
||||||
PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig" \
|
|
||||||
LDFLAGS="-L$PREFIX/lib"
|
|
||||||
|
|
||||||
And run ``make install`` to build and install.
|
|
||||||
|
|
||||||
After prerequisite libraries are prepared, run ``android-config`` and
|
After prerequisite libraries are prepared, run ``android-config`` and
|
||||||
then ``android-make`` to compile nghttp2 source files.
|
then ``android-make`` to compile nghttp2 source files.
|
||||||
|
|
||||||
|
|||||||
@@ -229,12 +229,18 @@ Hot swapping
|
|||||||
nghttpx supports hot swapping using signals. The hot swapping in
|
nghttpx supports hot swapping using signals. The hot swapping in
|
||||||
nghttpx is multi step process. First send USR2 signal to nghttpx
|
nghttpx is multi step process. First send USR2 signal to nghttpx
|
||||||
process. It will do fork and execute new executable, using same
|
process. It will do fork and execute new executable, using same
|
||||||
command-line arguments and environment variables. At this point, both
|
command-line arguments and environment variables.
|
||||||
current and new processes can accept requests. To gracefully shutdown
|
|
||||||
current process, send QUIT signal to current nghttpx process. When
|
As of nghttpx version 1.20.0, that is all you have to do. The new
|
||||||
all existing frontend connections are done, the current process will
|
master process sends QUIT signal to the original process, when it is
|
||||||
exit. At this point, only new nghttpx process exists and serves
|
ready to serve requests, to shut it down gracefully.
|
||||||
incoming requests.
|
|
||||||
|
For earlier versions of nghttpx, you have to do one more thing. At
|
||||||
|
this point, both current and new processes can accept requests. To
|
||||||
|
gracefully shutdown current process, send QUIT signal to current
|
||||||
|
nghttpx process. When all existing frontend connections are done, the
|
||||||
|
current process will exit. At this point, only new nghttpx process
|
||||||
|
exists and serves incoming requests.
|
||||||
|
|
||||||
If you want to just reload configuration file without executing new
|
If you want to just reload configuration file without executing new
|
||||||
binary, send SIGHUP to nghttpx master process.
|
binary, send SIGHUP to nghttpx master process.
|
||||||
@@ -343,10 +349,9 @@ requests, do this:
|
|||||||
backend=serv1,3000;/;proto=h2
|
backend=serv1,3000;/;proto=h2
|
||||||
backend=serv1,3000;/ws/;proto=http/1.1
|
backend=serv1,3000;/ws/;proto=http/1.1
|
||||||
|
|
||||||
Note that the backends share the same pattern must have the same
|
The default backend protocol is HTTP/1.1.
|
||||||
backend protocol. The default backend protocol is HTTP/1.1.
|
|
||||||
|
|
||||||
TLS can be enabed per pattern basis:
|
TLS can be enabled per pattern basis:
|
||||||
|
|
||||||
.. code-block:: text
|
.. code-block:: text
|
||||||
|
|
||||||
@@ -356,6 +361,96 @@ TLS can be enabed per pattern basis:
|
|||||||
In the above case, connection to serv1 will be encrypted by TLS. On
|
In the above case, connection to serv1 will be encrypted by TLS. On
|
||||||
the other hand, connection to serv2 will not be encrypted by TLS.
|
the other hand, connection to serv2 will not be encrypted by TLS.
|
||||||
|
|
||||||
|
Dynamic hostname lookup
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
By default, nghttpx performs backend hostname lookup at start up, or
|
||||||
|
configuration reload, and keeps using them in its entire session. To
|
||||||
|
make nghttpx perform hostname lookup dynamically, use ``dns``
|
||||||
|
parameter in :option:`--backend` option, like so:
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
backend=foo.example.com;;dns
|
||||||
|
|
||||||
|
nghttpx will cache resolved addresses for certain period of time. To
|
||||||
|
change this cache period, use :option:`--dns-cache-timeout`.
|
||||||
|
|
||||||
|
Enable PROXY protocol
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
PROXY protocol can be enabled per frontend. In order to enable PROXY
|
||||||
|
protocol, use ``proxyproto`` parameter in :option:`--frontend` option,
|
||||||
|
like so:
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
frontend=*,443;proxyproto
|
||||||
|
|
||||||
|
PSK cipher suites
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
nghttpx supports pre-shared key (PSK) cipher suites for both frontend
|
||||||
|
and backend TLS connections. For frontend connection, use
|
||||||
|
:option:`--psk-secrets` option to specify a file which contains PSK
|
||||||
|
identity and secrets. The format of the file is
|
||||||
|
``<identity>:<hex-secret>``, where ``<identity>`` is PSK identity, and
|
||||||
|
``<hex-secret>`` is PSK secret in hex, like so:
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
client1:9567800e065e078085c241d54a01c6c3f24b3bab71a606600f4c6ad2c134f3b9
|
||||||
|
client2:b1376c3f8f6dcf7c886c5bdcceecd1e6f1d708622b6ddd21bda26ebd0c0bca99
|
||||||
|
|
||||||
|
nghttpx server accepts any of the identity and secret pairs in the
|
||||||
|
file. The default cipher suite list does not contain PSK cipher
|
||||||
|
suites. In order to use PSK, PSK cipher suite must be enabled by
|
||||||
|
using :option:`--ciphers` option. The desired PSK cipher suite may be
|
||||||
|
listed in `HTTP/2 cipher black list
|
||||||
|
<https://tools.ietf.org/html/rfc7540#appendix-A>`_. In order to use
|
||||||
|
such PSK cipher suite with HTTP/2, disable HTTP/2 cipher black list by
|
||||||
|
using :option:`--no-http2-cipher-black-list` option. But you should
|
||||||
|
understand its implications.
|
||||||
|
|
||||||
|
At the time of writing, even if only PSK cipher suites are specified
|
||||||
|
in :option:`--ciphers` option, certificate and private key are still
|
||||||
|
required.
|
||||||
|
|
||||||
|
For backend connection, use :option:`--client-psk-secrets` option to
|
||||||
|
specify a file which contains single PSK identity and secret. The
|
||||||
|
format is the same as the file used by :option:`--psk-secrets`
|
||||||
|
described above, but only first identity and secret pair is solely
|
||||||
|
used, like so:
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
client2:b1376c3f8f6dcf7c886c5bdcceecd1e6f1d708622b6ddd21bda26ebd0c0bca99
|
||||||
|
|
||||||
|
The default cipher suite list does not contain PSK cipher suites. In
|
||||||
|
order to use PSK, PSK cipher suite must be enabled by using
|
||||||
|
:option:`--client-ciphers` option. The desired PSK cipher suite may
|
||||||
|
be listed in `HTTP/2 cipher black list
|
||||||
|
<https://tools.ietf.org/html/rfc7540#appendix-A>`_. In order to use
|
||||||
|
such PSK cipher suite with HTTP/2, disable HTTP/2 cipher black list by
|
||||||
|
using :option:`--client-no-http2-cipher-black-list` option. But you
|
||||||
|
should understand its implications.
|
||||||
|
|
||||||
|
Migration from nghttpx v1.18.x or earlier
|
||||||
|
-----------------------------------------
|
||||||
|
|
||||||
|
As of nghttpx v1.19.0, :option:`--ciphers` option only changes cipher
|
||||||
|
list for frontend TLS connection. In order to change cipher list for
|
||||||
|
backend connection, use :option:`--client-ciphers` option.
|
||||||
|
|
||||||
|
Similarly, :option:`--no-http2-cipher-black-list` option only disables
|
||||||
|
HTTP/2 cipher black list for frontend connection. In order to disable
|
||||||
|
HTTP/2 cipher black list for backend connection, use
|
||||||
|
:option:`--client-no-http2-cipher-black-list` option.
|
||||||
|
|
||||||
|
``--accept-proxy-protocol`` option was deprecated. Instead, use
|
||||||
|
``proxyproto`` parameter in :option:`--frontend` option to enable
|
||||||
|
PROXY protocol support per frontend.
|
||||||
|
|
||||||
Migration from nghttpx v1.8.0 or earlier
|
Migration from nghttpx v1.8.0 or earlier
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -29,10 +29,6 @@ if(ENABLE_EXAMPLES)
|
|||||||
add_executable(libevent-server libevent-server.c $<TARGET_OBJECTS:http-parser>)
|
add_executable(libevent-server libevent-server.c $<TARGET_OBJECTS:http-parser>)
|
||||||
add_executable(deflate deflate.c $<TARGET_OBJECTS:http-parser>)
|
add_executable(deflate deflate.c $<TARGET_OBJECTS:http-parser>)
|
||||||
|
|
||||||
if(ENABLE_TINY_NGHTTPD)
|
|
||||||
add_executable(tiny-nghttpd tiny-nghttpd.c $<TARGET_OBJECTS:http-parser>)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(ENABLE_ASIO_LIB)
|
if(ENABLE_ASIO_LIB)
|
||||||
foreach(name asio-sv asio-sv2 asio-cl asio-cl2)
|
foreach(name asio-sv asio-sv2 asio-cl asio-cl2)
|
||||||
add_executable(${name} ${name}.cc $<TARGET_OBJECTS:http-parser>)
|
add_executable(${name} ${name}.cc $<TARGET_OBJECTS:http-parser>)
|
||||||
|
|||||||
@@ -51,14 +51,6 @@ libevent_server_SOURCES = libevent-server.c
|
|||||||
|
|
||||||
deflate_SOURCES = deflate.c
|
deflate_SOURCES = deflate.c
|
||||||
|
|
||||||
if ENABLE_TINY_NGHTTPD
|
|
||||||
|
|
||||||
noinst_PROGRAMS += tiny-nghttpd
|
|
||||||
|
|
||||||
tiny_nghttpd_SOURCES = tiny-nghttpd.c
|
|
||||||
|
|
||||||
endif # ENABLE_TINY_NGHTTPD
|
|
||||||
|
|
||||||
if ENABLE_ASIO_LIB
|
if ENABLE_ASIO_LIB
|
||||||
|
|
||||||
noinst_PROGRAMS += asio-sv asio-sv2 asio-cl asio-cl2
|
noinst_PROGRAMS += asio-sv asio-sv2 asio-cl asio-cl2
|
||||||
|
|||||||
@@ -159,10 +159,13 @@ static void diec(const char *func, int error_code) {
|
|||||||
* bytes actually written. See the documentation of
|
* bytes actually written. See the documentation of
|
||||||
* nghttp2_send_callback for the details.
|
* nghttp2_send_callback for the details.
|
||||||
*/
|
*/
|
||||||
static ssize_t send_callback(nghttp2_session *session _U_, const uint8_t *data,
|
static ssize_t send_callback(nghttp2_session *session, const uint8_t *data,
|
||||||
size_t length, int flags _U_, void *user_data) {
|
size_t length, int flags, void *user_data) {
|
||||||
struct Connection *connection;
|
struct Connection *connection;
|
||||||
int rv;
|
int rv;
|
||||||
|
(void)session;
|
||||||
|
(void)flags;
|
||||||
|
|
||||||
connection = (struct Connection *)user_data;
|
connection = (struct Connection *)user_data;
|
||||||
connection->want_io = IO_NONE;
|
connection->want_io = IO_NONE;
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
@@ -186,10 +189,13 @@ static ssize_t send_callback(nghttp2_session *session _U_, const uint8_t *data,
|
|||||||
* |length| bytes. Returns the number of bytes stored in |buf|. See
|
* |length| bytes. Returns the number of bytes stored in |buf|. See
|
||||||
* the documentation of nghttp2_recv_callback for the details.
|
* the documentation of nghttp2_recv_callback for the details.
|
||||||
*/
|
*/
|
||||||
static ssize_t recv_callback(nghttp2_session *session _U_, uint8_t *buf,
|
static ssize_t recv_callback(nghttp2_session *session, uint8_t *buf,
|
||||||
size_t length, int flags _U_, void *user_data) {
|
size_t length, int flags, void *user_data) {
|
||||||
struct Connection *connection;
|
struct Connection *connection;
|
||||||
int rv;
|
int rv;
|
||||||
|
(void)session;
|
||||||
|
(void)flags;
|
||||||
|
|
||||||
connection = (struct Connection *)user_data;
|
connection = (struct Connection *)user_data;
|
||||||
connection->want_io = IO_NONE;
|
connection->want_io = IO_NONE;
|
||||||
ERR_clear_error();
|
ERR_clear_error();
|
||||||
@@ -210,9 +216,10 @@ static ssize_t recv_callback(nghttp2_session *session _U_, uint8_t *buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int on_frame_send_callback(nghttp2_session *session,
|
static int on_frame_send_callback(nghttp2_session *session,
|
||||||
const nghttp2_frame *frame,
|
const nghttp2_frame *frame, void *user_data) {
|
||||||
void *user_data _U_) {
|
|
||||||
size_t i;
|
size_t i;
|
||||||
|
(void)user_data;
|
||||||
|
|
||||||
switch (frame->hd.type) {
|
switch (frame->hd.type) {
|
||||||
case NGHTTP2_HEADERS:
|
case NGHTTP2_HEADERS:
|
||||||
if (nghttp2_session_get_stream_user_data(session, frame->hd.stream_id)) {
|
if (nghttp2_session_get_stream_user_data(session, frame->hd.stream_id)) {
|
||||||
@@ -237,9 +244,10 @@ static int on_frame_send_callback(nghttp2_session *session,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int on_frame_recv_callback(nghttp2_session *session,
|
static int on_frame_recv_callback(nghttp2_session *session,
|
||||||
const nghttp2_frame *frame,
|
const nghttp2_frame *frame, void *user_data) {
|
||||||
void *user_data _U_) {
|
|
||||||
size_t i;
|
size_t i;
|
||||||
|
(void)user_data;
|
||||||
|
|
||||||
switch (frame->hd.type) {
|
switch (frame->hd.type) {
|
||||||
case NGHTTP2_HEADERS:
|
case NGHTTP2_HEADERS:
|
||||||
if (frame->headers.cat == NGHTTP2_HCAT_RESPONSE) {
|
if (frame->headers.cat == NGHTTP2_HCAT_RESPONSE) {
|
||||||
@@ -274,9 +282,11 @@ static int on_frame_recv_callback(nghttp2_session *session,
|
|||||||
* we submit GOAWAY and close the session.
|
* we submit GOAWAY and close the session.
|
||||||
*/
|
*/
|
||||||
static int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
|
static int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
|
||||||
uint32_t error_code _U_,
|
uint32_t error_code, void *user_data) {
|
||||||
void *user_data _U_) {
|
|
||||||
struct Request *req;
|
struct Request *req;
|
||||||
|
(void)error_code;
|
||||||
|
(void)user_data;
|
||||||
|
|
||||||
req = nghttp2_session_get_stream_user_data(session, stream_id);
|
req = nghttp2_session_get_stream_user_data(session, stream_id);
|
||||||
if (req) {
|
if (req) {
|
||||||
int rv;
|
int rv;
|
||||||
@@ -293,11 +303,13 @@ static int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
|
|||||||
* The implementation of nghttp2_on_data_chunk_recv_callback type. We
|
* The implementation of nghttp2_on_data_chunk_recv_callback type. We
|
||||||
* use this function to print the received response body.
|
* use this function to print the received response body.
|
||||||
*/
|
*/
|
||||||
static int on_data_chunk_recv_callback(nghttp2_session *session,
|
static int on_data_chunk_recv_callback(nghttp2_session *session, uint8_t flags,
|
||||||
uint8_t flags _U_, int32_t stream_id,
|
int32_t stream_id, const uint8_t *data,
|
||||||
const uint8_t *data, size_t len,
|
size_t len, void *user_data) {
|
||||||
void *user_data _U_) {
|
|
||||||
struct Request *req;
|
struct Request *req;
|
||||||
|
(void)flags;
|
||||||
|
(void)user_data;
|
||||||
|
|
||||||
req = nghttp2_session_get_stream_user_data(session, stream_id);
|
req = nghttp2_session_get_stream_user_data(session, stream_id);
|
||||||
if (req) {
|
if (req) {
|
||||||
printf("[INFO] C <---------------------------- S (DATA chunk)\n"
|
printf("[INFO] C <---------------------------- S (DATA chunk)\n"
|
||||||
@@ -338,10 +350,13 @@ static void setup_nghttp2_callbacks(nghttp2_session_callbacks *callbacks) {
|
|||||||
* HTTP/2 protocol, if server does not offer HTTP/2 the nghttp2
|
* HTTP/2 protocol, if server does not offer HTTP/2 the nghttp2
|
||||||
* library supports, we terminate program.
|
* library supports, we terminate program.
|
||||||
*/
|
*/
|
||||||
static int select_next_proto_cb(SSL *ssl _U_, unsigned char **out,
|
static int select_next_proto_cb(SSL *ssl, unsigned char **out,
|
||||||
unsigned char *outlen, const unsigned char *in,
|
unsigned char *outlen, const unsigned char *in,
|
||||||
unsigned int inlen, void *arg _U_) {
|
unsigned int inlen, void *arg) {
|
||||||
int rv;
|
int rv;
|
||||||
|
(void)ssl;
|
||||||
|
(void)arg;
|
||||||
|
|
||||||
/* nghttp2_select_next_protocol() selects HTTP/2 protocol the
|
/* nghttp2_select_next_protocol() selects HTTP/2 protocol the
|
||||||
nghttp2 library supports. */
|
nghttp2 library supports. */
|
||||||
rv = nghttp2_select_next_protocol(out, outlen, in, inlen);
|
rv = nghttp2_select_next_protocol(out, outlen, in, inlen);
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ static void deflate(nghttp2_hd_deflater *deflater,
|
|||||||
static int inflate_header_block(nghttp2_hd_inflater *inflater, uint8_t *in,
|
static int inflate_header_block(nghttp2_hd_inflater *inflater, uint8_t *in,
|
||||||
size_t inlen, int final);
|
size_t inlen, int final);
|
||||||
|
|
||||||
int main(int argc _U_, char **argv _U_) {
|
int main() {
|
||||||
int rv;
|
int rv;
|
||||||
nghttp2_hd_deflater *deflater;
|
nghttp2_hd_deflater *deflater;
|
||||||
nghttp2_hd_inflater *inflater;
|
nghttp2_hd_inflater *inflater;
|
||||||
|
|||||||
@@ -199,22 +199,27 @@ static void print_headers(FILE *f, nghttp2_nv *nva, size_t nvlen) {
|
|||||||
/* nghttp2_send_callback. Here we transmit the |data|, |length| bytes,
|
/* nghttp2_send_callback. Here we transmit the |data|, |length| bytes,
|
||||||
to the network. Because we are using libevent bufferevent, we just
|
to the network. Because we are using libevent bufferevent, we just
|
||||||
write those bytes into bufferevent buffer. */
|
write those bytes into bufferevent buffer. */
|
||||||
static ssize_t send_callback(nghttp2_session *session _U_, const uint8_t *data,
|
static ssize_t send_callback(nghttp2_session *session, const uint8_t *data,
|
||||||
size_t length, int flags _U_, void *user_data) {
|
size_t length, int flags, void *user_data) {
|
||||||
http2_session_data *session_data = (http2_session_data *)user_data;
|
http2_session_data *session_data = (http2_session_data *)user_data;
|
||||||
struct bufferevent *bev = session_data->bev;
|
struct bufferevent *bev = session_data->bev;
|
||||||
|
(void)session;
|
||||||
|
(void)flags;
|
||||||
|
|
||||||
bufferevent_write(bev, data, length);
|
bufferevent_write(bev, data, length);
|
||||||
return (ssize_t)length;
|
return (ssize_t)length;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* nghttp2_on_header_callback: Called when nghttp2 library emits
|
/* nghttp2_on_header_callback: Called when nghttp2 library emits
|
||||||
single header name/value pair. */
|
single header name/value pair. */
|
||||||
static int on_header_callback(nghttp2_session *session _U_,
|
static int on_header_callback(nghttp2_session *session,
|
||||||
const nghttp2_frame *frame, const uint8_t *name,
|
const nghttp2_frame *frame, const uint8_t *name,
|
||||||
size_t namelen, const uint8_t *value,
|
size_t namelen, const uint8_t *value,
|
||||||
size_t valuelen, uint8_t flags _U_,
|
size_t valuelen, uint8_t flags, void *user_data) {
|
||||||
void *user_data) {
|
|
||||||
http2_session_data *session_data = (http2_session_data *)user_data;
|
http2_session_data *session_data = (http2_session_data *)user_data;
|
||||||
|
(void)session;
|
||||||
|
(void)flags;
|
||||||
|
|
||||||
switch (frame->hd.type) {
|
switch (frame->hd.type) {
|
||||||
case NGHTTP2_HEADERS:
|
case NGHTTP2_HEADERS:
|
||||||
if (frame->headers.cat == NGHTTP2_HCAT_RESPONSE &&
|
if (frame->headers.cat == NGHTTP2_HCAT_RESPONSE &&
|
||||||
@@ -229,10 +234,12 @@ static int on_header_callback(nghttp2_session *session _U_,
|
|||||||
|
|
||||||
/* nghttp2_on_begin_headers_callback: Called when nghttp2 library gets
|
/* nghttp2_on_begin_headers_callback: Called when nghttp2 library gets
|
||||||
started to receive header block. */
|
started to receive header block. */
|
||||||
static int on_begin_headers_callback(nghttp2_session *session _U_,
|
static int on_begin_headers_callback(nghttp2_session *session,
|
||||||
const nghttp2_frame *frame,
|
const nghttp2_frame *frame,
|
||||||
void *user_data) {
|
void *user_data) {
|
||||||
http2_session_data *session_data = (http2_session_data *)user_data;
|
http2_session_data *session_data = (http2_session_data *)user_data;
|
||||||
|
(void)session;
|
||||||
|
|
||||||
switch (frame->hd.type) {
|
switch (frame->hd.type) {
|
||||||
case NGHTTP2_HEADERS:
|
case NGHTTP2_HEADERS:
|
||||||
if (frame->headers.cat == NGHTTP2_HCAT_RESPONSE &&
|
if (frame->headers.cat == NGHTTP2_HCAT_RESPONSE &&
|
||||||
@@ -247,9 +254,11 @@ static int on_begin_headers_callback(nghttp2_session *session _U_,
|
|||||||
|
|
||||||
/* nghttp2_on_frame_recv_callback: Called when nghttp2 library
|
/* nghttp2_on_frame_recv_callback: Called when nghttp2 library
|
||||||
received a complete frame from the remote peer. */
|
received a complete frame from the remote peer. */
|
||||||
static int on_frame_recv_callback(nghttp2_session *session _U_,
|
static int on_frame_recv_callback(nghttp2_session *session,
|
||||||
const nghttp2_frame *frame, void *user_data) {
|
const nghttp2_frame *frame, void *user_data) {
|
||||||
http2_session_data *session_data = (http2_session_data *)user_data;
|
http2_session_data *session_data = (http2_session_data *)user_data;
|
||||||
|
(void)session;
|
||||||
|
|
||||||
switch (frame->hd.type) {
|
switch (frame->hd.type) {
|
||||||
case NGHTTP2_HEADERS:
|
case NGHTTP2_HEADERS:
|
||||||
if (frame->headers.cat == NGHTTP2_HCAT_RESPONSE &&
|
if (frame->headers.cat == NGHTTP2_HCAT_RESPONSE &&
|
||||||
@@ -266,11 +275,13 @@ static int on_frame_recv_callback(nghttp2_session *session _U_,
|
|||||||
is meant to the stream we initiated, print the received data in
|
is meant to the stream we initiated, print the received data in
|
||||||
stdout, so that the user can redirect its output to the file
|
stdout, so that the user can redirect its output to the file
|
||||||
easily. */
|
easily. */
|
||||||
static int on_data_chunk_recv_callback(nghttp2_session *session _U_,
|
static int on_data_chunk_recv_callback(nghttp2_session *session, uint8_t flags,
|
||||||
uint8_t flags _U_, int32_t stream_id,
|
int32_t stream_id, const uint8_t *data,
|
||||||
const uint8_t *data, size_t len,
|
size_t len, void *user_data) {
|
||||||
void *user_data) {
|
|
||||||
http2_session_data *session_data = (http2_session_data *)user_data;
|
http2_session_data *session_data = (http2_session_data *)user_data;
|
||||||
|
(void)session;
|
||||||
|
(void)flags;
|
||||||
|
|
||||||
if (session_data->stream_data->stream_id == stream_id) {
|
if (session_data->stream_data->stream_id == stream_id) {
|
||||||
fwrite(data, 1, len, stdout);
|
fwrite(data, 1, len, stdout);
|
||||||
}
|
}
|
||||||
@@ -287,7 +298,7 @@ static int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
|
|||||||
int rv;
|
int rv;
|
||||||
|
|
||||||
if (session_data->stream_data->stream_id == stream_id) {
|
if (session_data->stream_data->stream_id == stream_id) {
|
||||||
fprintf(stderr, "Stream %d closed with error_code=%d\n", stream_id,
|
fprintf(stderr, "Stream %d closed with error_code=%u\n", stream_id,
|
||||||
error_code);
|
error_code);
|
||||||
rv = nghttp2_session_terminate_session(session, NGHTTP2_NO_ERROR);
|
rv = nghttp2_session_terminate_session(session, NGHTTP2_NO_ERROR);
|
||||||
if (rv != 0) {
|
if (rv != 0) {
|
||||||
@@ -300,9 +311,12 @@ static int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
|
|||||||
/* NPN TLS extension client callback. We check that server advertised
|
/* NPN TLS extension client callback. We check that server advertised
|
||||||
the HTTP/2 protocol the nghttp2 library supports. If not, exit
|
the HTTP/2 protocol the nghttp2 library supports. If not, exit
|
||||||
the program. */
|
the program. */
|
||||||
static int select_next_proto_cb(SSL *ssl _U_, unsigned char **out,
|
static int select_next_proto_cb(SSL *ssl, unsigned char **out,
|
||||||
unsigned char *outlen, const unsigned char *in,
|
unsigned char *outlen, const unsigned char *in,
|
||||||
unsigned int inlen, void *arg _U_) {
|
unsigned int inlen, void *arg) {
|
||||||
|
(void)ssl;
|
||||||
|
(void)arg;
|
||||||
|
|
||||||
if (nghttp2_select_next_protocol(out, outlen, in, inlen) <= 0) {
|
if (nghttp2_select_next_protocol(out, outlen, in, inlen) <= 0) {
|
||||||
errx(1, "Server did not advertise " NGHTTP2_PROTO_VERSION_ID);
|
errx(1, "Server did not advertise " NGHTTP2_PROTO_VERSION_ID);
|
||||||
}
|
}
|
||||||
@@ -461,8 +475,10 @@ static void readcb(struct bufferevent *bev, void *ptr) {
|
|||||||
receiving GOAWAY, we check the some conditions on the nghttp2
|
receiving GOAWAY, we check the some conditions on the nghttp2
|
||||||
library and output buffer of bufferevent. If it indicates we have
|
library and output buffer of bufferevent. If it indicates we have
|
||||||
no business to this session, tear down the connection. */
|
no business to this session, tear down the connection. */
|
||||||
static void writecb(struct bufferevent *bev _U_, void *ptr) {
|
static void writecb(struct bufferevent *bev, void *ptr) {
|
||||||
http2_session_data *session_data = (http2_session_data *)ptr;
|
http2_session_data *session_data = (http2_session_data *)ptr;
|
||||||
|
(void)bev;
|
||||||
|
|
||||||
if (nghttp2_session_want_read(session_data->session) == 0 &&
|
if (nghttp2_session_want_read(session_data->session) == 0 &&
|
||||||
nghttp2_session_want_write(session_data->session) == 0 &&
|
nghttp2_session_want_write(session_data->session) == 0 &&
|
||||||
evbuffer_get_length(bufferevent_get_output(session_data->bev)) == 0) {
|
evbuffer_get_length(bufferevent_get_output(session_data->bev)) == 0) {
|
||||||
|
|||||||
@@ -109,18 +109,23 @@ struct app_context {
|
|||||||
static unsigned char next_proto_list[256];
|
static unsigned char next_proto_list[256];
|
||||||
static size_t next_proto_list_len;
|
static size_t next_proto_list_len;
|
||||||
|
|
||||||
static int next_proto_cb(SSL *s _U_, const unsigned char **data,
|
static int next_proto_cb(SSL *ssl, const unsigned char **data,
|
||||||
unsigned int *len, void *arg _U_) {
|
unsigned int *len, void *arg) {
|
||||||
|
(void)ssl;
|
||||||
|
(void)arg;
|
||||||
|
|
||||||
*data = next_proto_list;
|
*data = next_proto_list;
|
||||||
*len = (unsigned int)next_proto_list_len;
|
*len = (unsigned int)next_proto_list_len;
|
||||||
return SSL_TLSEXT_ERR_OK;
|
return SSL_TLSEXT_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
|
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
|
||||||
static int alpn_select_proto_cb(SSL *ssl _U_, const unsigned char **out,
|
static int alpn_select_proto_cb(SSL *ssl, const unsigned char **out,
|
||||||
unsigned char *outlen, const unsigned char *in,
|
unsigned char *outlen, const unsigned char *in,
|
||||||
unsigned int inlen, void *arg _U_) {
|
unsigned int inlen, void *arg) {
|
||||||
int rv;
|
int rv;
|
||||||
|
(void)ssl;
|
||||||
|
(void)arg;
|
||||||
|
|
||||||
rv = nghttp2_select_next_protocol((unsigned char **)out, outlen, in, inlen);
|
rv = nghttp2_select_next_protocol((unsigned char **)out, outlen, in, inlen);
|
||||||
|
|
||||||
@@ -197,8 +202,10 @@ static void add_stream(http2_session_data *session_data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void remove_stream(http2_session_data *session_data _U_,
|
static void remove_stream(http2_session_data *session_data,
|
||||||
http2_stream_data *stream_data) {
|
http2_stream_data *stream_data) {
|
||||||
|
(void)session_data;
|
||||||
|
|
||||||
stream_data->prev->next = stream_data->next;
|
stream_data->prev->next = stream_data->next;
|
||||||
if (stream_data->next) {
|
if (stream_data->next) {
|
||||||
stream_data->next->prev = stream_data->prev;
|
stream_data->next->prev = stream_data->prev;
|
||||||
@@ -309,10 +316,13 @@ static int session_recv(http2_session_data *session_data) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t send_callback(nghttp2_session *session _U_, const uint8_t *data,
|
static ssize_t send_callback(nghttp2_session *session, const uint8_t *data,
|
||||||
size_t length, int flags _U_, void *user_data) {
|
size_t length, int flags, void *user_data) {
|
||||||
http2_session_data *session_data = (http2_session_data *)user_data;
|
http2_session_data *session_data = (http2_session_data *)user_data;
|
||||||
struct bufferevent *bev = session_data->bev;
|
struct bufferevent *bev = session_data->bev;
|
||||||
|
(void)session;
|
||||||
|
(void)flags;
|
||||||
|
|
||||||
/* Avoid excessive buffering in server side. */
|
/* Avoid excessive buffering in server side. */
|
||||||
if (evbuffer_get_length(bufferevent_get_output(session_data->bev)) >=
|
if (evbuffer_get_length(bufferevent_get_output(session_data->bev)) >=
|
||||||
OUTPUT_WOULDBLOCK_THRESHOLD) {
|
OUTPUT_WOULDBLOCK_THRESHOLD) {
|
||||||
@@ -375,13 +385,17 @@ static char *percent_decode(const uint8_t *value, size_t valuelen) {
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ssize_t file_read_callback(nghttp2_session *session _U_,
|
static ssize_t file_read_callback(nghttp2_session *session, int32_t stream_id,
|
||||||
int32_t stream_id _U_, uint8_t *buf,
|
uint8_t *buf, size_t length,
|
||||||
size_t length, uint32_t *data_flags,
|
uint32_t *data_flags,
|
||||||
nghttp2_data_source *source,
|
nghttp2_data_source *source,
|
||||||
void *user_data _U_) {
|
void *user_data) {
|
||||||
int fd = source->fd;
|
int fd = source->fd;
|
||||||
ssize_t r;
|
ssize_t r;
|
||||||
|
(void)session;
|
||||||
|
(void)stream_id;
|
||||||
|
(void)user_data;
|
||||||
|
|
||||||
while ((r = read(fd, buf, length)) == -1 && errno == EINTR)
|
while ((r = read(fd, buf, length)) == -1 && errno == EINTR)
|
||||||
;
|
;
|
||||||
if (r == -1) {
|
if (r == -1) {
|
||||||
@@ -454,10 +468,12 @@ static int error_reply(nghttp2_session *session,
|
|||||||
static int on_header_callback(nghttp2_session *session,
|
static int on_header_callback(nghttp2_session *session,
|
||||||
const nghttp2_frame *frame, const uint8_t *name,
|
const nghttp2_frame *frame, const uint8_t *name,
|
||||||
size_t namelen, const uint8_t *value,
|
size_t namelen, const uint8_t *value,
|
||||||
size_t valuelen, uint8_t flags _U_,
|
size_t valuelen, uint8_t flags, void *user_data) {
|
||||||
void *user_data _U_) {
|
|
||||||
http2_stream_data *stream_data;
|
http2_stream_data *stream_data;
|
||||||
const char PATH[] = ":path";
|
const char PATH[] = ":path";
|
||||||
|
(void)flags;
|
||||||
|
(void)user_data;
|
||||||
|
|
||||||
switch (frame->hd.type) {
|
switch (frame->hd.type) {
|
||||||
case NGHTTP2_HEADERS:
|
case NGHTTP2_HEADERS:
|
||||||
if (frame->headers.cat != NGHTTP2_HCAT_REQUEST) {
|
if (frame->headers.cat != NGHTTP2_HCAT_REQUEST) {
|
||||||
@@ -570,9 +586,10 @@ static int on_frame_recv_callback(nghttp2_session *session,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
|
static int on_stream_close_callback(nghttp2_session *session, int32_t stream_id,
|
||||||
uint32_t error_code _U_, void *user_data) {
|
uint32_t error_code, void *user_data) {
|
||||||
http2_session_data *session_data = (http2_session_data *)user_data;
|
http2_session_data *session_data = (http2_session_data *)user_data;
|
||||||
http2_stream_data *stream_data;
|
http2_stream_data *stream_data;
|
||||||
|
(void)error_code;
|
||||||
|
|
||||||
stream_data = nghttp2_session_get_stream_user_data(session, stream_id);
|
stream_data = nghttp2_session_get_stream_user_data(session, stream_id);
|
||||||
if (!stream_data) {
|
if (!stream_data) {
|
||||||
@@ -625,8 +642,10 @@ static int send_server_connection_header(http2_session_data *session_data) {
|
|||||||
|
|
||||||
/* readcb for bufferevent after client connection header was
|
/* readcb for bufferevent after client connection header was
|
||||||
checked. */
|
checked. */
|
||||||
static void readcb(struct bufferevent *bev _U_, void *ptr) {
|
static void readcb(struct bufferevent *bev, void *ptr) {
|
||||||
http2_session_data *session_data = (http2_session_data *)ptr;
|
http2_session_data *session_data = (http2_session_data *)ptr;
|
||||||
|
(void)bev;
|
||||||
|
|
||||||
if (session_recv(session_data) != 0) {
|
if (session_recv(session_data) != 0) {
|
||||||
delete_http2_session_data(session_data);
|
delete_http2_session_data(session_data);
|
||||||
return;
|
return;
|
||||||
@@ -658,12 +677,13 @@ static void writecb(struct bufferevent *bev, void *ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* eventcb for bufferevent */
|
/* eventcb for bufferevent */
|
||||||
static void eventcb(struct bufferevent *bev _U_, short events, void *ptr) {
|
static void eventcb(struct bufferevent *bev, short events, void *ptr) {
|
||||||
http2_session_data *session_data = (http2_session_data *)ptr;
|
http2_session_data *session_data = (http2_session_data *)ptr;
|
||||||
if (events & BEV_EVENT_CONNECTED) {
|
if (events & BEV_EVENT_CONNECTED) {
|
||||||
const unsigned char *alpn = NULL;
|
const unsigned char *alpn = NULL;
|
||||||
unsigned int alpnlen = 0;
|
unsigned int alpnlen = 0;
|
||||||
SSL *ssl;
|
SSL *ssl;
|
||||||
|
(void)bev;
|
||||||
|
|
||||||
fprintf(stderr, "%s connected\n", session_data->client_addr);
|
fprintf(stderr, "%s connected\n", session_data->client_addr);
|
||||||
|
|
||||||
@@ -703,10 +723,11 @@ static void eventcb(struct bufferevent *bev _U_, short events, void *ptr) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* callback for evconnlistener */
|
/* callback for evconnlistener */
|
||||||
static void acceptcb(struct evconnlistener *listener _U_, int fd,
|
static void acceptcb(struct evconnlistener *listener, int fd,
|
||||||
struct sockaddr *addr, int addrlen, void *arg) {
|
struct sockaddr *addr, int addrlen, void *arg) {
|
||||||
app_context *app_ctx = (app_context *)arg;
|
app_context *app_ctx = (app_context *)arg;
|
||||||
http2_session_data *session_data;
|
http2_session_data *session_data;
|
||||||
|
(void)listener;
|
||||||
|
|
||||||
session_data = create_http2_session_data(app_ctx, fd, addr, addrlen);
|
session_data = create_http2_session_data(app_ctx, fd, addr, addrlen);
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
33
fuzz/README.rst
Normal file
33
fuzz/README.rst
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
Fuzzer
|
||||||
|
======
|
||||||
|
|
||||||
|
This directory contains fuzzer target mainly written to integrate
|
||||||
|
nghttp2 into `oss-fuzz <https://github.com/google/oss-fuzz>`_.
|
||||||
|
|
||||||
|
fuzz_target.cc contains an entry point of fuzzer. corpus directory
|
||||||
|
contains initial data for fuzzer.
|
||||||
|
|
||||||
|
The file name of initial data under corpus is the lower-cased hex
|
||||||
|
string of SHA-256 hash of its own content.
|
||||||
|
|
||||||
|
corpus/h2spec contains input data which was recorded when we ran
|
||||||
|
`h2spec <https://github.com/summerwind/h2spec>`_ against nghttpd.
|
||||||
|
|
||||||
|
corpus/nghttp contains input data which was recorded when we ran
|
||||||
|
nghttp against nghttpd with some varying command line options of
|
||||||
|
nghttp.
|
||||||
|
|
||||||
|
|
||||||
|
To build fuzz_target.cc, make sure that libnghttp2 is built with
|
||||||
|
following compiler/linker flags:
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
CPPFLAGS="-fsanitize-coverage=edge -fsanitize=addres"
|
||||||
|
LDFLAGS="-fsanitize-coverage=edge -fsanitize=addres"
|
||||||
|
|
||||||
|
Then, fuzz_target.cc can be built using the following command:
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
$ clang++ -fsanitize-coverage=edge -fsanitize=address -I../lib/includes -std=c++11 fuzz_target.cc ../lib/.libs/libnghttp2.a /usr/lib/llvm-3.9/lib/libFuzzer.a -o nghttp2_fuzzer
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
|
|||||||
|
INVALID CONNECTION PREFACE
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user