Package org.microproxy
Class Http2Options
java.lang.Object
org.microproxy.Http2Options
Limits for HTTP/2 client connections (
HttpProxyServerBootstrap.withHttp2(boolean)). Every
value has a default meant for browsers and API clients; a peer that goes past a limit gets its
stream refused or reset, or the connection closed with GOAWAY. The window sizes apply to
the proxy's connections to servers too (HttpProxyServerBootstrap.withHttp2Upstream(boolean)), and
Http2Options.Builder.coalesceConnections(boolean) lets those serve more than one server name.
The rate limits count frames received within one window
(10 seconds by default); the count starts again with each window.
MicroProxy.bootstrap()
.withManInTheMiddle(mitm) // HTTP/2 to clients and servers is on by default
.withHttp2Options(Http2Options.builder().maxConcurrentStreams(250).build())
.start();
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Http2OptionsThe defaults: see eachHttp2Options.Buildermethod. -
Method Summary
Modifier and TypeMethodDescriptionstatic Http2Options.Builderbuilder()Starts a builder with the default settings.booleanWhether an HTTP/2 connection to a server may carry requests for other server names than the one it was made for (connection coalescing, RFC 9113 section 9.1.1).intReturns the connection's receive window: request body bytes buffered per connection, at most.intSETTINGS_INITIAL_WINDOW_SIZE: request body bytes buffered per stream, at most.intSETTINGS_MAX_CONCURRENT_STREAMS: streams a client may have open at once.intDATA frames without data or END_STREAM, and empty trailing HEADERS, per window.intSETTINGS_MAX_HEADER_LIST_SIZE, or 0 for the default: the proxy'smax_header_sizeplusmax_initial_line_length, the same room an HTTP/1 request head has.intmaxPings()PING frames per window.intReturns streams the client may reset (or open past the concurrency limit) before they complete, per window.intRST_STREAM and PRIORITY frames per window.intSETTINGS frames per window.intWINDOW_UPDATE frames per window.Returns the window the rate limits count frames in.Returns how long the client may take to acknowledge the proxy's SETTINGS.Starts a builder initialized with these settings.toString()
-
Field Details
-
DEFAULT
The defaults: see eachHttp2Options.Buildermethod.
-
-
Method Details
-
builder
Starts a builder with the default settings.- Returns:
- a new builder with default settings
-
toBuilder
Starts a builder initialized with these settings.- Returns:
- a new builder initialized with these settings
-
maxConcurrentStreams
public int maxConcurrentStreams()SETTINGS_MAX_CONCURRENT_STREAMS: streams a client may have open at once.- Returns:
- the maximum simultaneous client streams
-
initialWindowSize
public int initialWindowSize()SETTINGS_INITIAL_WINDOW_SIZE: request body bytes buffered per stream, at most.- Returns:
- the stream receive window size in bytes
-
connectionWindowSize
public int connectionWindowSize()Returns the connection's receive window: request body bytes buffered per connection, at most.- Returns:
- the connection's receive window: request body bytes buffered per connection, at most
-
maxHeaderListSize
public int maxHeaderListSize()SETTINGS_MAX_HEADER_LIST_SIZE, or 0 for the default: the proxy'smax_header_sizeplusmax_initial_line_length, the same room an HTTP/1 request head has.- Returns:
- the maximum header list size in bytes, or zero to derive it from HTTP/1 limits
-
settingsAckTimeout
Returns how long the client may take to acknowledge the proxy's SETTINGS.- Returns:
- how long the client may take to acknowledge the proxy's SETTINGS
-
rateWindow
Returns the window the rate limits count frames in.- Returns:
- the window the rate limits count frames in
-
maxRapidResets
public int maxRapidResets()Returns streams the client may reset (or open past the concurrency limit) before they complete, per window.- Returns:
- streams the client may reset (or open past the concurrency limit) before they complete, per window
-
maxPings
public int maxPings()PING frames per window.- Returns:
- the maximum PING frames per rate window
-
maxSettings
public int maxSettings()SETTINGS frames per window.- Returns:
- the maximum SETTINGS frames per rate window
-
maxResets
public int maxResets()RST_STREAM and PRIORITY frames per window.- Returns:
- the maximum RST_STREAM and PRIORITY frames per rate window
-
maxWindowUpdates
public int maxWindowUpdates()WINDOW_UPDATE frames per window.- Returns:
- the maximum WINDOW_UPDATE frames per rate window
-
maxEmptyFrames
public int maxEmptyFrames()DATA frames without data or END_STREAM, and empty trailing HEADERS, per window.- Returns:
- the maximum empty frames per rate window
-
coalesceConnections
public boolean coalesceConnections()Whether an HTTP/2 connection to a server may carry requests for other server names than the one it was made for (connection coalescing, RFC 9113 section 9.1.1).- Returns:
- true if connections to servers are coalesced
- See Also:
-
toString
-