Package org.microproxy
Class Http2Options.Builder
java.lang.Object
org.microproxy.Http2Options.Builder
- Enclosing class:
Http2Options
Builds
Http2Options.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates the configured HTTP/2 limits.coalesceConnections(boolean coalesce) Lets the proxy's HTTP/2 connections to servers (HttpProxyServerBootstrap.withHttp2Upstream(boolean)) carry requests for other server names than the one each was made for, as RFC 9113 section 9.1.1 allows (default off).connectionWindowSize(int bytes) The connection's flow-control window (default 1 MiB): the most the proxy buffers for all of a connection's streams together.initialWindowSize(int bytes) The flow-control window of each stream's request body (default 256 KiB): the most the proxy buffers for a stream whose body it has not read yet.maxConcurrentStreams(int n) Streams a client may have open at once (default 100).maxEmptyFrames(int n) Frames that carry nothing, DATA frames with no data and no END_STREAM, per window (default 1000); more isGOAWAY ENHANCE_YOUR_CALM.maxHeaderListSize(int bytes) The largest request header section, counted as HTTP/2 counts it (names and values plus 32 octets per field); larger requests have their stream reset. 0 (the default) derives it from the HTTP/1 limits:withMaxHeaderSizepluswithMaxInitialLineLength.maxPings(int n) PING frames per window (default 100); more isGOAWAY ENHANCE_YOUR_CALM.maxRapidResets(int n) Streams the client may reset before their response completes, or open past the concurrency limit, per window (default 100), against the Rapid Reset attack (CVE-2023-44487); more isGOAWAY ENHANCE_YOUR_CALM.maxResets(int n) RST_STREAM and PRIORITY frames per window (default 1000); more isGOAWAY ENHANCE_YOUR_CALM.maxSettings(int n) SETTINGS frames per window (default 100); more isGOAWAY ENHANCE_YOUR_CALM.maxWindowUpdates(int n) WINDOW_UPDATE frames per window (default 10000); more isGOAWAY ENHANCE_YOUR_CALM.rateWindow(Duration window) The window the rate limits below count frames in (default 10 s).settingsAckTimeout(Duration timeout) How long the client may take to acknowledge the proxy's SETTINGS (default 10 s) beforeGOAWAY SETTINGS_TIMEOUT.
-
Method Details
-
maxConcurrentStreams
Streams a client may have open at once (default 100). Each runs its own exchange, with its own server connection; streams beyond the limit are refused withREFUSED_STREAM, which clients retry.- Parameters:
n- the maximum streams open at once- Returns:
- this builder
-
initialWindowSize
The flow-control window of each stream's request body (default 256 KiB): the most the proxy buffers for a stream whose body it has not read yet.- Parameters:
bytes- the stream receive window size, at least 65535 bytes- Returns:
- this builder
-
connectionWindowSize
The connection's flow-control window (default 1 MiB): the most the proxy buffers for all of a connection's streams together.- Parameters:
bytes- the connection receive window size, at least 65535 bytes- Returns:
- this builder
-
maxHeaderListSize
The largest request header section, counted as HTTP/2 counts it (names and values plus 32 octets per field); larger requests have their stream reset. 0 (the default) derives it from the HTTP/1 limits:withMaxHeaderSizepluswithMaxInitialLineLength.- Parameters:
bytes- the maximum header list size, or zero to derive it from HTTP/1 limits- Returns:
- this builder
-
settingsAckTimeout
How long the client may take to acknowledge the proxy's SETTINGS (default 10 s) beforeGOAWAY SETTINGS_TIMEOUT.- Parameters:
timeout- the maximum wait for a SETTINGS acknowledgement- Returns:
- this builder
-
rateWindow
The window the rate limits below count frames in (default 10 s).- Parameters:
window- the frame-counting window duration- Returns:
- this builder
-
maxRapidResets
Streams the client may reset before their response completes, or open past the concurrency limit, per window (default 100), against the Rapid Reset attack (CVE-2023-44487); more isGOAWAY ENHANCE_YOUR_CALM.- Parameters:
n- the maximum rapid resets per window- Returns:
- this builder
-
maxPings
PING frames per window (default 100); more isGOAWAY ENHANCE_YOUR_CALM.- Parameters:
n- the maximum PING frames per window- Returns:
- this builder
-
maxSettings
SETTINGS frames per window (default 100); more isGOAWAY ENHANCE_YOUR_CALM.- Parameters:
n- the maximum SETTINGS frames per window- Returns:
- this builder
-
maxResets
RST_STREAM and PRIORITY frames per window (default 1000); more isGOAWAY ENHANCE_YOUR_CALM.- Parameters:
n- the maximum RST_STREAM and PRIORITY frames per window- Returns:
- this builder
-
maxWindowUpdates
WINDOW_UPDATE frames per window (default 10000); more isGOAWAY ENHANCE_YOUR_CALM.- Parameters:
n- the maximum WINDOW_UPDATE frames per window- Returns:
- this builder
-
maxEmptyFrames
Frames that carry nothing, DATA frames with no data and no END_STREAM, per window (default 1000); more isGOAWAY ENHANCE_YOUR_CALM.- Parameters:
n- the maximum empty frames per window- Returns:
- this builder
-
coalesceConnections
Lets the proxy's HTTP/2 connections to servers (HttpProxyServerBootstrap.withHttp2Upstream(boolean)) carry requests for other server names than the one each was made for, as RFC 9113 section 9.1.1 allows (default off). A request forb.example.commay then take a stream on the connection made fora.example.comwhen the certificate that server presented is valid forb.example.com, and eitherb.example.comresolves (with the proxy's own resolver) to the address the connection went to, or the server named it in an ORIGIN frame (RFC 8336).Connections are never coalesced across routes (direct, or through which chained proxy), MITM managers, client connections whose connections are private, or TLS settings: the context the MITM manager gives each name must be the same, a manager that configures server sockets itself keeps every connection to its own name, and a connection on which the proxy presented a client certificate serves no other name. A request that a server answers
421 Misdirected Requeston a coalesced connection is sent again on a connection of its own when it can be (no body, a buffered one, or one not read yet), and that name is not coalesced onto that connection again.- Parameters:
coalesce- true to coalesce connections to servers- Returns:
- this builder
-
build
Creates the configured HTTP/2 limits.- Returns:
- the configured HTTP/2 limits
-