Commit Graph

149 Commits

Author SHA1 Message Date
Tatsuhiro Tsujikawa a7c780a732 nghttpx: Redirect to HTTPS URI with redirect-if-not-tls param
This commit removes frontend-tls parameter, and adds
redirect-if-not-tls parameter parameter to --backend option.  nghttpx
now responds to the request with 308 status code to redirect the
request to https URI if frontend connection is not TLS encrypted, and
redirect-if-no-tls parameter is used in --backend option.  The port
number in Location header field is 443 by default (thus omitted), but
it can be configurable using --redirect-https-port option.
2017-02-18 22:32:27 +09:00
Tatsuhiro Tsujikawa 5311185333 nghttpx: Define the maximum number of digits in uint64_t 2017-01-22 22:33:52 +09:00
Tatsuhiro Tsujikawa 0f33749790 nghttp: Take into account scheme and port when parsing HTML links
Previously, when parsing HTML links, we only take into account
overridden host.  But we actually need more variables to consider.  In
this commit, we take into account overridden scheme, host, and port to
parse HTML links.
2017-01-18 00:29:51 +09:00
Tatsuhiro Tsujikawa 4be5de1163 src: Move log related functions from util.cc to shrpx_log.cc 2017-01-09 19:34:40 +09:00
Tatsuhiro Tsujikawa 6595ae26ea src: Add constexpr to const objects 2017-01-09 17:11:37 +09:00
Tatsuhiro Tsujikawa 83c759572c nghttpx: Add --psk-secret option to enable PSK in frontend connection 2017-01-08 00:35:54 +09:00
Tatsuhiro Tsujikawa 38b5cad4e3 nghttpx: Lookup backend host name dynamically
We have added "dns" parameter to backend option.  If specified, name
lookup is done dynamically.  If not, name lookup is done at start up,
or configuration reloading.  nghttpx caches DNS result including error
case in 30 seconds in this commit.  Later commit makes this
configurable.

DNS resolution is done asynchronously using c-ares library.
2016-12-10 21:09:50 +09:00
Tatsuhiro Tsujikawa 0cf6848646 clang-format-3.9 2016-10-15 18:36:04 +09:00
Tatsuhiro Tsujikawa 1a37044d3c nghttpx: Use pre-allocated buffer for timestamp string 2016-10-11 22:32:26 +09:00
Tatsuhiro Tsujikawa 9254c563ca Fix compile error with gcc 2016-10-03 22:52:14 +09:00
Tatsuhiro Tsujikawa 4b5179a544 nghttpx: Fix bug in util::make_hostport 2016-10-03 22:09:45 +09:00
Tatsuhiro Tsujikawa 272cfa320e nghttpx: Use BlockAllocator per DownstreamConfig 2016-10-02 22:28:43 +09:00
Tatsuhiro Tsujikawa 5aec60fbeb nghtpx: Add BlockAllocator version of base64 2016-10-02 22:28:43 +09:00
Tatsuhiro Tsujikawa e1a865c406 nghttpx: Add BlockAllocator version of util::formax_hex 2016-10-02 22:28:42 +09:00
Tatsuhiro Tsujikawa 5e03b6a0db nghttpx: Use BlockAllocator for util::quote_string 2016-10-02 00:07:26 +09:00
Tatsuhiro Tsujikawa b85924bf70 nghttpx: Use BlockAllocator to encode alt-svc token 2016-10-02 00:00:46 +09:00
Tatsuhiro Tsujikawa 8a9810ed32 nghttpx: Add BlockAllocator to ClientHandler 2016-10-01 22:54:17 +09:00
Tatsuhiro Tsujikawa cf7f87c2ad nghttpx: Log error code from getsockopt(SO_ERROR) on first write event 2016-08-25 00:25:03 +09:00
Tatsuhiro Tsujikawa 2bbe4422d2 nghttpx: Use consistent hashing for client IP based session affinity
We use technique described in https://github.com/RJ/ketama
2016-07-06 23:31:10 +09:00
Tatsuhiro Tsujikawa fd7d3c57d7 nghttpx: Use faster version of power
In our use case, x and y is quite small, and there is no chance for
overflow, and y is always integer.
2016-06-27 22:42:28 +09:00
Tatsuhiro Tsujikawa f74d7ea119 src: Don't allow const char * in starts_with 2016-03-25 23:20:48 +09:00
Tatsuhiro Tsujikawa 2bca6360b6 src: Don't allow const char * in istarts_with and istarts_with_l 2016-03-25 23:18:31 +09:00
Tatsuhiro Tsujikawa 841b3c87db src: Don't allow const char * in ends_with and ends_with_l 2016-03-25 23:04:44 +09:00
Tatsuhiro Tsujikawa 2ab79f4938 src: Don't allow const char * in iends_with and iends_with_l 2016-03-25 23:00:34 +09:00
Tatsuhiro Tsujikawa 2182a85875 src: Make strifind functin template 2016-03-25 22:56:23 +09:00
Tatsuhiro Tsujikawa 72d8d78d36 src: Don't allow const char * in 2nd argument of streq_l(S[N], T) 2016-03-25 22:53:31 +09:00
Tatsuhiro Tsujikawa dad61d032e src: Don't allow const char * in 2nd argument of strieq_l(S[N], T) 2016-03-25 22:51:20 +09:00
Tatsuhiro Tsujikawa 1bbb241baa src: Make streq(T, S) function template 2016-03-25 22:48:13 +09:00
Tatsuhiro Tsujikawa 3e6c38e3be src: Made strieq(T, S) template 2016-03-25 22:45:33 +09:00
Tatsuhiro Tsujikawa a46c815e4e src: StringRef-fy 2016-03-25 01:41:06 +09:00
Tatsuhiro Tsujikawa 79968c6374 src: Rewrite strifind 2016-03-25 00:27:59 +09:00
Tatsuhiro Tsujikawa 1699aef609 src: Remove strcompare 2016-03-25 00:16:25 +09:00
Tatsuhiro Tsujikawa 2d2d6c3cc0 src: Remove istarts_with(const char*) overload 2016-03-25 00:14:12 +09:00
Tatsuhiro Tsujikawa bfccab9b9f src: Remove starts_with(const char*, const char*) overload 2016-03-25 00:09:53 +09:00
Tatsuhiro Tsujikawa 0875e66aab src: Remove streq(const char *) overload 2016-03-25 00:02:07 +09:00
Tatsuhiro Tsujikawa 372123c178 nghttpx: Remove strieq(const char*, cosnt char*) overload, and fix unittests 2016-03-24 23:34:56 +09:00
Tatsuhiro Tsujikawa 13596bde90 nghttpx: Refactor option handling using StringRef 2016-03-24 22:15:58 +09:00
Tatsuhiro Tsujikawa db1ee3aa88 nghttpd: Use StringRef 2016-03-19 20:57:40 +09:00
Tatsuhiro Tsujikawa d64051fedc src: Return StringRef from http2::stringify_status 2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa c897d5b294 src: Use StringRef in parse_http_date 2016-03-12 21:13:09 +09:00
Tatsuhiro Tsujikawa 7a412df9a5 nghttpx: Fix tests 2016-03-12 21:12:26 +09:00
Tatsuhiro Tsujikawa b1b57cc740 nghttpx: Use StringRef for authority, scheme and path 2016-03-12 21:12:26 +09:00
Tatsuhiro Tsujikawa bae37e3e4a nghttpx: Add custom memory allocator mainly for header related objects 2016-03-09 21:16:28 +09:00
Tatsuhiro Tsujikawa 907eeeda8a src: Return StringRef from util::get_uri_field 2016-03-08 21:38:15 +09:00
Tatsuhiro Tsujikawa 06921f35f3 nghttpx: Restructure mode settings
It is very hard to support multiple protocols in backend while
retaining multiple mode settings.  Therefore, we dropped modes except
for default and HTTP/2 proxy mode.  The other removed modes can be
emulated using combinations of options.  Now the backend connection is
not encrypted by default.  To enable encryption on backend connection,
use --backend-tls option.
2016-02-28 21:35:26 +09:00
Tatsuhiro Tsujikawa dfc02843b6 src: Rename and rewrite numeric_hostport as to_numeric_addr and support AF_UNIX path 2016-02-21 15:28:11 +09:00
Tatsuhiro Tsujikawa eb0c82d91f nghttpx: More log output when resolving addresses for better debugging 2016-02-13 23:21:32 +09:00
Tatsuhiro Tsujikawa ba4c268172 nghttpx: Single SSL_SESSION cache entry for each address 2016-02-11 17:07:48 +09:00
Tatsuhiro Tsujikawa 4fb4617d20 src: Parameterize CharT 2016-02-07 18:16:47 +09:00
Tatsuhiro Tsujikawa ede0f6aa32 src: Remove verbose const 2016-02-07 18:12:57 +09:00