blob: 8ee58a81442f14ae9908ef3f21f069aa9d886715 [file]
# Copyright (c) 2016 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
config HTTP_PARSER
bool "HTTP Parser support"
select HTTP_PARSER_URL
help
This option enables the http_parser library from nodejs.
This parser requires some string-related routines commonly
provided by a libc implementation.
config HTTP_PARSER_URL
bool "HTTP Parser for URL support"
help
This option enables the URI parser library based on source from nodejs.
This parser requires some string-related routines commonly
provided by a libc implementation.
config HTTP_PARSER_STRICT
bool "HTTP strict parsing"
depends on (HTTP_PARSER || HTTP_PARSER_URL)
help
This option enables the strict parsing option
config HTTP_CLIENT
bool "HTTP client API"
select HTTP_PARSER
select HTTP_PARSER_URL
help
HTTP client API
config HTTP_CLIENT_SEND_BUF_SIZE
int "HTTP client request send buffer size"
depends on HTTP_CLIENT
default 192
range 64 4096
help
Size of the temporary stack buffer used by the HTTP client while
constructing and sending request headers. Larger values can reduce
socket send calls at the cost of additional stack usage.
menuconfig HTTP_SERVER
bool "HTTP Server [EXPERIMENTAL]"
select HTTP_PARSER
select HTTP_PARSER_URL
select EXPERIMENTAL
select NET_SOCKETS
select ZVFS
select ZVFS_EVENTFD
imply NET_IPV4_MAPPING_TO_IPV6 if NET_IPV4 && NET_IPV6
help
HTTP1, HTTP2 and HTTP3 server support.
if HTTP_SERVER
config ZVFS_EVENTFD_ADD_SIZE_HTTP_SERVER
int "Number of eventfds needed by the HTTP server"
default 1
help
The HTTP server allocates one permanent zvfs eventfd to wake up its
poll loop.
config HTTP_SERVER_VERSION_1
bool "HTTP/1.x support"
select NET_TCP if NET_NATIVE
default y
help
Support HTTP 1.x version.
config HTTP_SERVER_VERSION_2
bool "HTTP/2 support"
select NET_TCP if NET_NATIVE
default y
help
Support HTTP/2 version.
config HTTP_SERVER_VERSION_3
bool "HTTP/3 support"
depends on QUIC
select NET_SOCKETS_SOCKOPT_TLS
default y
help
Support HTTP/3 version. This depends on QUIC transport protocol support.
config HTTP_SERVER_VERSION
int
default 123 if HTTP_SERVER_VERSION_1 && HTTP_SERVER_VERSION_2 && HTTP_SERVER_VERSION_3
default 23 if !HTTP_SERVER_VERSION_1 && HTTP_SERVER_VERSION_2 && HTTP_SERVER_VERSION_3
default 13 if HTTP_SERVER_VERSION_1 && !HTTP_SERVER_VERSION_2 && HTTP_SERVER_VERSION_3
default 12 if HTTP_SERVER_VERSION_1 && HTTP_SERVER_VERSION_2 && !HTTP_SERVER_VERSION_3
default 3 if !HTTP_SERVER_VERSION_1 && !HTTP_SERVER_VERSION_2 && HTTP_SERVER_VERSION_3
default 2 if !HTTP_SERVER_VERSION_1 && HTTP_SERVER_VERSION_2 && !HTTP_SERVER_VERSION_3
default 1 if HTTP_SERVER_VERSION_1 && !HTTP_SERVER_VERSION_2 && !HTTP_SERVER_VERSION_3
default 0
help
What HTTP version is supported in HTTP server.
config HTTP_SERVER_TO_H3_UPGRADE
bool "Advertise HTTP/3 upgrade by default"
depends on HTTP_SERVER_VERSION_3
default y
help
If enabled, then services that support HTTP/3 send
Alt-Svc: h3=":443"; ma=86400
in HTTP/1 header so that the client can know it can connect using HTTP/3.
Individual services can override this default in http_service_config.
config HTTP_SERVER_TO_H3_UPGRADE_MAX_AGE_SECS
int "What is the max age of the HTTP/3 upgrade (in secs)"
depends on HTTP_SERVER_TO_H3_UPGRADE
default 86400
help
Default is 1 day (86400 seconds)
config HTTP_SERVER_STACK_SIZE
int "HTTP server thread stack size"
default 4096 if FILE_SYSTEM
default 3072
help
HTTP server thread stack size for processing RX/TX events.
config HTTP_SERVER_NUM_SERVICES
int "Number of HTTP Server Instances"
default QUIC_MAX_CONTEXTS if HTTP_SERVER_VERSION_3 && !HTTP_SERVER_VERSION_2 && \
!HTTP_SERVER_VERSION_1
default 3 if HTTP_SERVER_VERSION_3 && HTTP_SERVER_VERSION_2 && HTTP_SERVER_VERSION_1
default 2 if HTTP_SERVER_VERSION_3 && HTTP_SERVER_VERSION_2 && !HTTP_SERVER_VERSION_1
default 2 if HTTP_SERVER_VERSION_3 && !HTTP_SERVER_VERSION_2 && HTTP_SERVER_VERSION_1
default 2 if !HTTP_SERVER_VERSION_3 && HTTP_SERVER_VERSION_2 && HTTP_SERVER_VERSION_1
default 1
range 1 100
help
This setting determines the number of http services that the server supports.
config HTTP_SERVER_MAX_CLIENTS
int "Max number of HTTP/2/3 clients"
default QUIC_MAX_ENDPOINTS if HTTP_SERVER_VERSION_3
default 3
range 1 100
help
This setting determines the maximum number of HTTP/2 or HTTP/3 clients that
the server can handle at once.
config HTTP_SERVER_MAX_STREAMS
int "Max number of HTTP/2 streams"
default 10
range 1 100
help
This setting determines the maximum number of HTTP/2 streams
for each client.
config HTTP_SERVER_CLIENT_BUFFER_SIZE
int "Client Buffer Size"
default 256
range 64 $(UINT32_MAX)
help
This setting determines the buffer size for each client.
config HTTP_SERVER_HUFFMAN_DECODE_BUFFER_SIZE
int "Size of the buffer used for decoding Huffman-encoded strings"
default 256
range 64 $(UINT32_MAX)
help
Size of the buffer used for decoding Huffman-encoded strings when
processing HPACK compressed headers. This effectively limits the
maximum length of an individual HTTP header supported.
config HTTP_SERVER_MAX_URL_LENGTH
int "Maximum HTTP URL Length"
default 256
range 32 2048
help
This setting determines the maximum length of the HTTP URL that the server can process.
config HTTP_SERVER_MAX_CONTENT_TYPE_LENGTH
int "Maximum HTTP Content-Type Length"
default 64
range 1 128
help
This setting determines the maximum length of the HTTP Content-Length field.
config HTTP_SERVER_MAX_HEADER_LEN
int "Maximum HTTP Header Field/Value Length"
default 32
range 32 512
help
This setting determines the maximum length of HTTP header field or value
that can be parsed. The default value is sufficient for HTTP server
internal header processing, and only needs to be increased if the
application wishes to access headers of a greater length.
config HTTP_SERVER_HTTP2_MAX_HEADER_FRAME_LEN
int "Maximum HTTP/2 response header frame length"
default 64
range 64 2048
help
This setting determines the maximum length of an HTTP/2 header frame
(applies to response headers only, not request headers). The default
value is sufficient for the standard headers included with a response,
and only needs to be increased if the application wishes to send
additional response headers.
config HTTP_SERVER_CAPTURE_HEADERS
bool "Allow capturing HTTP headers for application use"
help
This setting enables the HTTP server to capture selected headers that have
been registered by the application.
Captured headers are delivered to the dynamic resource callback only in
the first callback for a given request, and are not available in any
subsequent callback.
config HTTP_SERVER_CAPTURE_HEADER_BUFFER_SIZE
int "Size of buffer for capturing HTTP headers for application use"
default 128
range 32 2048
depends on HTTP_SERVER_CAPTURE_HEADERS
help
This setting determines the size of the (per-client) buffer used to store
HTTP headers for later use by the application.
config HTTP_SERVER_CAPTURE_HEADER_COUNT
int "Maximum number of HTTP headers to be captured for application use"
default 3
range 1 100
depends on HTTP_SERVER_CAPTURE_HEADERS
help
This setting determines the maximum number of HTTP headers it is possible
to capture for application use in a single HTTP request.
config HTTP_SERVER_CLIENT_INACTIVITY_TIMEOUT
int "Client inactivity timeout (seconds)"
default 5 if HTTP_SERVER_VERSION_3
default 10
range 1 86400
help
This timeout specifies maximum time the client may remain inactive
(i. e. not sending or receiving any data) before the server drops the
connection.
config HTTP_SERVER_WEBSOCKET
bool "Allow upgrading to Websocket connection"
select PSA_WANT_ALG_SHA_1
select WEBSOCKET_CLIENT
select WEBSOCKET
help
If this is enabled, then the user can allow the HTTP connection to be
upgraded to a Websocket connection. The user can then define a Websocket
handler that is called after upgrading to handle the Websocket network
traffic.
config HTTP_SERVER_RESOURCE_WILDCARD
bool "Allow wildcard matching of resources"
# The POSIX_C_LIB_EXT will get fnmatch() support
select POSIX_C_LIB_EXT
help
Allow user to specify wildcards when setting up resource strings.
This means that instead of specifying multiple resources with exact
string matches, one resource handler could handle multiple URLs.
config HTTP_SERVER_RESTART_DELAY
int "Delay before re-initialization when restarting server"
default 1000
range 1 60000
help
In case server restarts for any reason, the server re-initialization
will be delayed by this value (milliseconds). The delay is needed to
allow any existing connections to finalize to avoid binding errors
during initialization.
config HTTP_SERVER_TLS_USE_ALPN
bool "ALPN support for HTTPS server"
depends on NET_SOCKETS_SOCKOPT_TLS
# depends on MBEDTLS_SSL_ALPN
default y if HTTP_SERVER_VERSION_3
help
Use ALPN (application layer protocol negotiation) to negotiate HTTP2/3
protocol for TLS connections. Web browsers use this mechanism to determine
whether HTTP2 or HTTP3 is supported.
config HTTP_SERVER_REPORT_FAILURE_REASON
bool "Report failure reason in HTTP 500 Internal Server Error reply"
help
If enabled, the server will include the failure reason within
HTTP 500 Internal Server Error response. Otherwise, no information
is provided within the message.
config WEBSOCKET_CONSOLE
bool
default y if HTTP_SERVER_WEBSOCKET && SHELL_BACKEND_WEBSOCKET
help
Hidden option that is enabled only when all the necessary options
needed by websocket console are set.
config HTTP_SERVER_COMPRESSION
bool "Compression support in HTTP fileserver"
help
If enabled, the fileserver will parse the accept-encoding header
from the client and extract the supported compression methods.
Afterwards it will try to serve the first compressed file available
by using the file ending as compression indicator in this order:
1. brotli -> .br
2. gzip -> .gz
3. zstd -> .zst
4. compress -> .lzw
5. deflate -> .zz
6. File without compression
config HTTP_SERVER_STATIC_FS_RESPONSE_SIZE
int "Size of static file system response buffer"
depends on FILE_SYSTEM
default 1024
help
The size of a single chunk when serving static files from the file system.
This config value must be large enough to hold the headers in a single chunk.
If set to 0, the server will use the minimal viable buffer size for the response.
Please note that it is allocated on the stack of the HTTP server thread,
so CONFIG_HTTP_SERVER_STACK_SIZE has to be sufficiently large.
config HTTP_SERVER_COMPLETE_STATUS_PHRASES
bool "Complete HTTP status reason phrases"
help
Include reason phrases for HTTP status codes in server responses.
When disabled, HTTP responses will not include reason phrases,
reducing code size. Note that reason phrases are optional per
HTTP specification and their absence does not affect protocol
compliance or client behavior.
endif
# Hidden option to avoid having multiple individual options that are ORed together
config HTTP
bool
depends on (HTTP_PARSER_URL || HTTP_PARSER || HTTP_CLIENT || HTTP_SERVER)
default y
module = NET_HTTP
module-dep = NET_LOG
module-str = Log level for HTTP client library
module-help = Enables HTTP client code to output debug messages.
source "subsys/net/Kconfig.template.log_config.net"
module = NET_HTTP_SERVER
module-dep = NET_LOG
module-str = Log level for HTTP server library
module-help = Enables HTTP server code to output debug messages.
source "subsys/net/Kconfig.template.log_config.net"