Package org.microproxy
Interface ProxyFailure
- All Known Implementing Classes:
ProxyFailure.BadRequest,ProxyFailure.BadServerResponse,ProxyFailure.ConnectFailed,ProxyFailure.NoConnectionAvailable,ProxyFailure.NoRoute,ProxyFailure.RequestTooLarge,ProxyFailure.ServerTimeout,ProxyFailure.TlsFailed,ProxyFailure.UnresolvedHost
public sealed interface ProxyFailure
permits ProxyFailure.UnresolvedHost, ProxyFailure.ConnectFailed, ProxyFailure.TlsFailed, ProxyFailure.ServerTimeout, ProxyFailure.BadServerResponse, ProxyFailure.NoRoute, ProxyFailure.NoConnectionAvailable, ProxyFailure.BadRequest, ProxyFailure.RequestTooLarge
Why the proxy has to answer a request itself instead of relaying the server's response. Each
failure knows the status of the proxy's default answer;
HttpFilters.proxyToServerFailure(org.microproxy.ProxyFailure)
and a FailureResponder can answer differently.
The default answers are short plain-text bodies (Bad Gateway, Gateway
Timeout, ...) that never echo the request. Requests the proxy cannot parse at all (malformed
or oversized heads, bad chunk framing) are answered with a plain 4xx without consulting
filters or the responder, since there is no request to hand over.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordThe proxy refuses the request: an origin-form request withoutHttpProxyServerBootstrap.withAllowRequestToOriginServer(boolean), anhttps://request withoutHttpProxyServerBootstrap.withTlsOrigination(boolean), or aCONNECTtarget that is nothost:port.static final recordThe server's response was malformed, or the server closed the connection or failed before the response head (or a body the filters asked to buffer) was complete.static final recordNo connection could be made to the server or any chained proxy offered for it: refused, unreachable, timed out, a chained proxy whose own name did not resolve, or a chained proxy that refused theCONNECTor SOCKS request.static final recordThe shared connection pool had no connection to spare within the connect timeout.static final recordThere is nowhere to send the request: it names no host (hostAndPortis null), or theChainedProxyManageroffered no route.static final recordThe request body is larger than the filters asked to buffer (maxBytes).static final recordThe server did not answer within the idle timeout.static final recordThe TLS handshake with the server (when intercepting) or with a TLS chained proxy failed or did not finish withinHttpProxyServerBootstrap.withTlsHandshakeTimeout(java.time.Duration)(or the request'sHttpFilters.proxyToServerTlsHandshakeTimeout()), e.g. because its certificate is not trusted.static final recordThe server's name did not resolve (direct connections). -
Method Summary
-
Method Details
-
status
HttpResponseStatus status()Returns the status of the proxy's default answer.- Returns:
- the status of the proxy's default answer
-