Uses of Class
org.microproxy.HttpFiltersBuilder
Packages that use HttpFiltersBuilder
-
Uses of HttpFiltersBuilder in org.microproxy
Methods in org.microproxy that return HttpFiltersBuilderModifier and TypeMethodDescriptionHttpFiltersBuilder.allowMitm(BooleanSupplier allow) Whether CONNECT requests may be intercepted (default true when MITM is configured).HttpFiltersBuilder.allowMitmFor(Predicate<? super ClientHello> allow) Whether a TLS connection may be intercepted, decided from the client'sClientHello(its server name and ALPN protocols); seeHttpFilters.proxyToServerAllowMitm(ClientHello).HttpFiltersBuilder.beforeResponding(UnaryOperator<HttpResponse> hook) The response head just before it goes to the client (proxyToClientResponse).HttpFiltersBuilder.beforeSending(Function<HttpRequest, HttpResponse> hook) The request head just before it goes to the server (proxyToServerRequest), with the proxy's own header changes applied.HttpFiltersBuilder.bufferRequests(int maxBytes) Buffer request bodies up tomaxBytes, soonRequestgets the whole request.HttpFiltersBuilder.bufferResponses(int maxBytes) Buffer response bodies up tomaxBytes, soonResponsegets the whole response.static HttpFiltersBuilderHttpFilters.builder()Starts filters made from lambdas, one per hook (seeHttpFiltersBuilder).HttpFiltersBuilder.connectTimeout(Duration timeout) The connect timeout for these requests' new connections, instead of the server's (seeHttpFilters.proxyToServerConnectTimeout()).HttpFiltersBuilder.log(HttpLogger logger) Logs each exchange withlogger, around these hooks: requests as the client sent them (beforeonRequest) and as forwarded (afterbeforeSending), responses as the server sent them (beforeonResponse) and as delivered (afterbeforeResponding).HttpFiltersBuilder.mitmServerHandshake(MitmServerHandshake handshake) When the proxy runs its TLS handshake with the server for these requests' interceptedCONNECTs, instead of the protocol policy's choice (seeHttpFilters.proxyToServerMitmHandshake()).HttpFiltersBuilder.onFailure(Function<ProxyFailure, HttpResponse> hook) The proxy's own answer when the request fails (proxyToServerFailure): return a response to send instead of the default, ornull.HttpFiltersBuilder.onRequest(Function<HttpRequest, HttpResponse> hook) The request head as the client sent it (clientToProxyRequest); a wholeFullHttpRequestwhen buffered (bufferRequests(int)).HttpFiltersBuilder.onRequestBody(Consumer<HttpContent> hook) Each piece of a streamed request body, ending with aLastHttpContent.HttpFiltersBuilder.onResponse(UnaryOperator<HttpResponse> hook) The response head from the server (serverToProxyResponse); a wholeFullHttpResponsewhen buffered (bufferResponses(int)).HttpFiltersBuilder.onResponseBody(UnaryOperator<HttpContent> hook) Each piece of a streamed response body: return it, a replacement, ornullto abort.HttpFiltersBuilder.onWebSocketFrame(BiFunction<WebSocketFrame, Boolean, WebSocketFrame> hook) Each WebSocket frame, with whether it came from the client: return it, a replacement, ornullto drop it (seeHttpFilters.filterWebSocketFrame(org.microproxy.http.WebSocketFrame, boolean)).HttpFiltersBuilder.onWebSocketMessage(BiFunction<WebSocketMessage, Boolean, WebSocketMessage> hook) Each whole WebSocket message, joined from its frames (and inflated), with whether it came from the client: return it, a replacement, ornullto drop it (seeHttpFilters.filterWebSocketMessage(org.microproxy.http.WebSocketMessage, boolean)).HttpFiltersBuilder.resolveWith(Function<String, InetSocketAddress> resolver) Chooses the server address forhost:port;nullresolves as usual.HttpFiltersBuilder.retryBackoff(RetryBackoff backoff) The backoff between these requests' attempts at the routes theChainedProxyManageroffered, instead of the server's (seeHttpFilters.chainedProxyRetryBackoff());RetryBackoff.none()retries at once.HttpFiltersBuilder.tlsHandshakeTimeout(Duration timeout) The upstream TLS handshake timeout for these requests' new connections, instead of the server's (seeHttpFilters.proxyToServerTlsHandshakeTimeout()).HttpFiltersBuilder.tlsIdentity(Function<String, TlsServerIdentity> identity) The TLS identity (server name and verification host) of these requests' connections to servers, by the server'shost:port; seeHttpFilters.proxyToServerTlsIdentity(java.lang.String).