Forwarder Test Httpbin #
Usage: forwarder test httpbin [--protocol <http|https|h2>] [--address <host:port>] [flags]
Start HTTP(S) server that serves httpbin.org API
Note: You can also specify the options as YAML, JSON or TOML file using --config-file
flag.
You can generate a config file by running forwarder test httpbin config-file
command.
Server options #
--address
#
- Environment variable:
FORWARDER_ADDRESS
- Value Format:
<host:port>
- Default value:
:8080
The server address to listen on. If the host is empty, the server will listen on all available interfaces.
--basic-auth
#
- Environment variable:
FORWARDER_BASIC_AUTH
- Value Format:
<username[:password]>
Basic authentication credentials to protect the server.
--idle-timeout
#
- Environment variable:
FORWARDER_IDLE_TIMEOUT
- Value Format:
<duration>
- Default value:
1h0m0s
The maximum amount of time to wait for the next request before closing connection.
--protocol
#
- Environment variable:
FORWARDER_PROTOCOL
- Value Format:
<http|https|h2>
- Default value:
http
The server protocol. For https and h2 protocols, if TLS certificate is not specified, the server will use a self-signed certificate.
--read-header-timeout
#
- Environment variable:
FORWARDER_READ_HEADER_TIMEOUT
- Value Format:
<duration>
- Default value:
1m0s
The amount of time allowed to read request headers.
--read-limit
#
- Environment variable:
FORWARDER_READ_LIMIT
- Value Format:
<bandwidth>
- Default value:
0
Global read rate limit in bytes per second i.e. how many bytes per second you can receive from a proxy. Accepts binary format (e.g. 1.5Ki, 1Mi, 3.6Gi).
--shutdown-timeout
#
- Environment variable:
FORWARDER_SHUTDOWN_TIMEOUT
- Value Format:
<duration>
- Default value:
30s
The maximum amount of time to wait for the server to drain connections before closing. Zero means no limit.
--tls-cert-file
#
- Environment variable:
FORWARDER_TLS_CERT_FILE
- Value Format:
<path or base64>
TLS certificate to use if the server protocol is https or h2.
Syntax:
- File:
/path/to/file.pac
- Embed:
data:base64,<base64 encoded data>
--tls-handshake-timeout
#
- Environment variable:
FORWARDER_TLS_HANDSHAKE_TIMEOUT
- Value Format:
<duration>
- Default value:
0s
The maximum amount of time to wait for a TLS handshake before closing connection. Zero means no limit.
--tls-key-file
#
- Environment variable:
FORWARDER_TLS_KEY_FILE
- Value Format:
<path or base64>
TLS private key to use if the server protocol is https or h2.
Syntax:
- File:
/path/to/file.pac
- Embed:
data:base64,<base64 encoded data>
--write-limit
#
- Environment variable:
FORWARDER_WRITE_LIMIT
- Value Format:
<bandwidth>
- Default value:
0
Global write rate limit in bytes per second i.e. how many bytes per second you can send to proxy. Accepts binary format (e.g. 1.5Ki, 1Mi, 3.6Gi).
Logging options #
--log-file
#
- Environment variable:
FORWARDER_LOG_FILE
- Value Format:
<path>
Path to the log file, if empty, logs to stdout. The file is reopened on SIGHUP to allow log rotation using external tools.
--log-http
#
- Environment variable:
FORWARDER_LOG_HTTP
- Value Format:
<none|short-url|url|headers|body|errors>,...
- Default value:
errors
HTTP request and response logging mode.
Modes:
- none: no logging
- short-url: logs [scheme://]host[/path] instead of the full URL
- url: logs the full URL including query parameters
- headers: logs request line and headers
- body: logs request line, headers, and body
- errors: logs request line and headers if status code is greater than or equal to 500
Modes for different modules can be specified separated by commas. The following example specifies that the API module logs errors, the proxy module logs headers, and anything else logs full URL.
--log-http=api:errors,proxy:headers,url
--log-level
#
- Environment variable:
FORWARDER_LOG_LEVEL
- Value Format:
<error|info|debug>
- Default value:
info
Log level.