Package org.microproxy
Class Http3Options
java.lang.Object
org.microproxy.Http3Options
Limits and timers for HTTP/3 (
HttpProxyServerBootstrap.withHttp3(boolean) and HttpProxyServerBootstrap.withHttp3Upstream(boolean)). Every value has a default meant for
browsers and API clients; a client that goes past a limit gets its stream reset, or the
connection closed with an HTTP/3 error code. Where HTTP/2 counts frames to defend itself,
HTTP/3 leaves much of the work to QUIC: the stream limit and flow control are QUIC's, enforced
by the transport.
The rate limits count events within one window (10
seconds by default); the count starts again with each window.
MicroProxy.bootstrap()
.withReverseProxy("https://backend.internal")
.withSslContextSource(new KeyStoreSslContextSource(Path.of("site.p12"), password))
.withHttp3(true)
.withHttp3Options(Http3Options.builder().maxConcurrentStreams(250).build())
.start();
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuildsHttp3Options.static enumThe congestion controllers of the proxy's QUIC connections (seeHttp3Options.Builder.quicCongestionControl). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Http3OptionsThe defaults: see eachHttp3Options.Buildermethod. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaltSvc()Returns whether a reverse proxy serving HTTP/3 advertises it with Alt-Svc on its TCP responses.Returns the max-age (ma) of the proxy's own Alt-Svc advertisement.static Http3Options.Builderbuilder()Starts a builder with the default settings.longReturns the flow-control window of a connection, for all its streams together.Returns how long a CONNECT-UDP flow lives without a datagram in either direction.booleanReturns whether QUIC inside CONNECT-UDP flows is decided on as transparent QUIC is, rather than relayed.intReturns the CONNECT-UDP flows the proxy relays at once.intReturns the CONNECT-UDP flows one client connection may have open at once.intReturns the datagrams a CONNECT-UDP flow queues in each direction, beyond which it drops them.longReturns the bytes of datagrams a CONNECT-UDP flow queues in each direction, beyond which it drops them.Returns the target ports of the CONNECT-UDP flows whose QUIC is decided on; empty for every port.Returns how long a CONNECT-UDP request that finds the proxy's bound on flows full waits for flows already ending to give their places back.Returns the URI template CONNECT-UDP requests name their target with (RFC 9298).intReturns the request streams a client may have open at once (QUIC's bidirectional stream limit).longSETTINGS_MAX_FIELD_SECTION_SIZE, or 0 for the default: the proxy'smax_header_sizeplusmax_initial_line_length, the same room an HTTP/1 request head has.intReturns requests a client may cancel before their response completes, per window.intReturns frames of unknown and reserved types, and empty DATA frames, a peer may send per window.intReturns unidirectional streams of unknown and reserved types a peer may open per window.Returns the directory the proxy's QUIC connections write qlog files to, or null for none.longReturns the largest a qlog file grows; past it, the connection's later events are left out.intReturns how many qlog files the directory keeps; past it, the oldest are deleted.intReturns SETTINGS_QPACK_BLOCKED_STREAMS: streams that may wait for the peer's QPACK encoder stream at once.longReturns SETTINGS_QPACK_MAX_TABLE_CAPACITY: the QPACK dynamic table each side may use, in bytes.Returns the congestion controller of the proxy's QUIC connections, to clients and to servers.Returns the window the rate limits count events in.booleanretry()Returns whether the HTTP/3 listeners validate client addresses with a QUIC Retry first.longReturns the flow-control window of each stream: the most a peer may send ahead of the proxy's reading.Starts a builder initialized with these settings.toString()longReturns the bytes of datagrams the transparent QUIC listener holds for new clients, all together.intReturns the new clients the transparent QUIC listener holds at once while it reads their ClientHellos.intReturns the new clients from one IP address that the transparent QUIC listener holds at once.intReturns the QUIC flows the transparent QUIC listener relays at once, each with a socket of its own.intReturns the relayed QUIC flows of one IP address at once.Returns how long the transparent QUIC listener waits for a new client's complete ClientHello, and its decision.Returns how long a relayed QUIC flow of the transparent QUIC listener lives without a datagram either way.Returns how long a server whose QUIC handshake failed is reached over TCP only.Returns how long a QUIC handshake with a server may take before its request goes over TCP instead.booleanWhether requests that are safe to replay go to HTTP/3 servers as 0-RTT early data when the proxy resumes a session with them: on by default.booleanzeroRtt()Whether the HTTP/3 listeners accept 0-RTT early data from clients that resume a session: off by default.
-
Field Details
-
DEFAULT
The defaults: see eachHttp3Options.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()Returns the request streams a client may have open at once (QUIC's bidirectional stream limit).- Returns:
- the request streams a client may have open at once (QUIC's bidirectional stream limit)
-
streamReceiveWindow
public long streamReceiveWindow()Returns the flow-control window of each stream: the most a peer may send ahead of the proxy's reading.- Returns:
- the flow-control window of each stream: the most a peer may send ahead of the proxy's reading
-
connectionReceiveWindow
public long connectionReceiveWindow()Returns the flow-control window of a connection, for all its streams together.- Returns:
- the flow-control window of a connection, for all its streams together
-
maxFieldSectionSize
public long maxFieldSectionSize()SETTINGS_MAX_FIELD_SECTION_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 largest field section accepted, or zero to derive it from the HTTP/1 limits
-
qpackMaxTableCapacity
public long qpackMaxTableCapacity()Returns SETTINGS_QPACK_MAX_TABLE_CAPACITY: the QPACK dynamic table each side may use, in bytes.- Returns:
- SETTINGS_QPACK_MAX_TABLE_CAPACITY: the QPACK dynamic table each side may use, in bytes
-
qpackBlockedStreams
public int qpackBlockedStreams()Returns SETTINGS_QPACK_BLOCKED_STREAMS: streams that may wait for the peer's QPACK encoder stream at once.- Returns:
- SETTINGS_QPACK_BLOCKED_STREAMS: streams that may wait for the peer's QPACK encoder stream at once
-
rateWindow
Returns the window the rate limits count events in.- Returns:
- the window the rate limits count events in
-
maxUnknownFrames
public int maxUnknownFrames()Returns frames of unknown and reserved types, and empty DATA frames, a peer may send per window.- Returns:
- frames of unknown and reserved types, and empty DATA frames, a peer may send per window
-
maxUnknownStreams
public int maxUnknownStreams()Returns unidirectional streams of unknown and reserved types a peer may open per window.- Returns:
- unidirectional streams of unknown and reserved types a peer may open per window
-
maxRapidResets
public int maxRapidResets()Returns requests a client may cancel before their response completes, per window.- Returns:
- requests a client may cancel before their response completes, per window
-
retry
public boolean retry()Returns whether the HTTP/3 listeners validate client addresses with a QUIC Retry first.- Returns:
- whether the HTTP/3 listeners validate client addresses with a QUIC Retry first
-
zeroRtt
public boolean zeroRtt()Whether the HTTP/3 listeners accept 0-RTT early data from clients that resume a session: off by default. SeeHttp3Options.Builder.zeroRtt(boolean).- Returns:
- whether 0-RTT is accepted
-
upstreamZeroRtt
public boolean upstreamZeroRtt()Whether requests that are safe to replay go to HTTP/3 servers as 0-RTT early data when the proxy resumes a session with them: on by default. SeeHttp3Options.Builder.upstreamZeroRtt(boolean).- Returns:
- whether the proxy sends 0-RTT data to servers
-
upstreamHandshakeTimeout
Returns how long a QUIC handshake with a server may take before its request goes over TCP instead.- Returns:
- how long a QUIC handshake with a server may take before its request goes over TCP instead
-
upstreamFailureTimeout
Returns how long a server whose QUIC handshake failed is reached over TCP only.- Returns:
- how long a server whose QUIC handshake failed is reached over TCP only
-
altSvc
public boolean altSvc()Returns whether a reverse proxy serving HTTP/3 advertises it with Alt-Svc on its TCP responses.- Returns:
- whether a reverse proxy serving HTTP/3 advertises it with Alt-Svc on its TCP responses
-
altSvcMaxAge
Returns the max-age (ma) of the proxy's own Alt-Svc advertisement.- Returns:
- the max-age (
ma) of the proxy's own Alt-Svc advertisement
-
transparentRelayIdleTimeout
Returns how long a relayed QUIC flow of the transparent QUIC listener lives without a datagram either way.- Returns:
- how long a relayed QUIC flow of the transparent QUIC listener lives without a datagram either way
-
transparentPendingTimeout
Returns how long the transparent QUIC listener waits for a new client's complete ClientHello, and its decision.- Returns:
- how long the transparent QUIC listener waits for a new client's complete ClientHello, and its decision
-
transparentMaxPending
public int transparentMaxPending()Returns the new clients the transparent QUIC listener holds at once while it reads their ClientHellos.- Returns:
- the new clients the transparent QUIC listener holds at once while it reads their ClientHellos
-
transparentMaxPendingPerSource
public int transparentMaxPendingPerSource()Returns the new clients from one IP address that the transparent QUIC listener holds at once.- Returns:
- the new clients from one IP address that the transparent QUIC listener holds at once
-
transparentMaxRelayFlows
public int transparentMaxRelayFlows()Returns the QUIC flows the transparent QUIC listener relays at once, each with a socket of its own.- Returns:
- the QUIC flows the transparent QUIC listener relays at once, each with a socket of its own
-
transparentMaxRelayFlowsPerSource
public int transparentMaxRelayFlowsPerSource()Returns the relayed QUIC flows of one IP address at once.- Returns:
- the relayed QUIC flows of one IP address at once
-
transparentMaxBufferedBytes
public long transparentMaxBufferedBytes()Returns the bytes of datagrams the transparent QUIC listener holds for new clients, all together.- Returns:
- the bytes of datagrams the transparent QUIC listener holds for new clients, all together
-
connectUdpTemplate
Returns the URI template CONNECT-UDP requests name their target with (RFC 9298).- Returns:
- the URI template CONNECT-UDP requests name their target with (RFC 9298)
-
connectUdpIdleTimeout
Returns how long a CONNECT-UDP flow lives without a datagram in either direction.- Returns:
- how long a CONNECT-UDP flow lives without a datagram in either direction
-
connectUdpMaxFlows
public int connectUdpMaxFlows()Returns the CONNECT-UDP flows the proxy relays at once.- Returns:
- the CONNECT-UDP flows the proxy relays at once
-
connectUdpMaxFlowsPerConnection
public int connectUdpMaxFlowsPerConnection()Returns the CONNECT-UDP flows one client connection may have open at once.- Returns:
- the CONNECT-UDP flows one client connection may have open at once
-
connectUdpReleaseWait
Returns how long a CONNECT-UDP request that finds the proxy's bound on flows full waits for flows already ending to give their places back.- Returns:
- how long a CONNECT-UDP request that finds the proxy's bound on flows full waits for flows already ending to give their places back
-
connectUdpMaxQueued
public int connectUdpMaxQueued()Returns the datagrams a CONNECT-UDP flow queues in each direction, beyond which it drops them.- Returns:
- the datagrams a CONNECT-UDP flow queues in each direction, beyond which it drops them
-
connectUdpMaxQueuedBytes
public long connectUdpMaxQueuedBytes()Returns the bytes of datagrams a CONNECT-UDP flow queues in each direction, beyond which it drops them.- Returns:
- the bytes of datagrams a CONNECT-UDP flow queues in each direction, beyond which it drops them
-
connectUdpInterceptQuic
public boolean connectUdpInterceptQuic()Returns whether QUIC inside CONNECT-UDP flows is decided on as transparent QUIC is, rather than relayed.- Returns:
- whether QUIC inside CONNECT-UDP flows is decided on as transparent QUIC is, rather than relayed
-
connectUdpQuicPorts
Returns the target ports of the CONNECT-UDP flows whose QUIC is decided on; empty for every port.- Returns:
- the target ports of the CONNECT-UDP flows whose QUIC is decided on; empty for every port
-
quicCongestionControl
Returns the congestion controller of the proxy's QUIC connections, to clients and to servers.- Returns:
- the congestion controller of the proxy's QUIC connections, to clients and to servers
-
qlogDirectory
Returns the directory the proxy's QUIC connections write qlog files to, or null for none.- Returns:
- the directory the proxy's QUIC connections write qlog files to, or null for none
-
qlogMaxFiles
public int qlogMaxFiles()Returns how many qlog files the directory keeps; past it, the oldest are deleted.- Returns:
- how many qlog files the directory keeps; past it, the oldest are deleted
-
qlogMaxFileBytes
public long qlogMaxFileBytes()Returns the largest a qlog file grows; past it, the connection's later events are left out.- Returns:
- the largest a qlog file grows; past it, the connection's later events are left out
-
toString
-