Uses of Class
org.microproxy.FlowContext
Packages that use FlowContext
Package
Description
OpenTelemetry for MicroProxy, with no dependencies but the JDK: W3C Trace Context, B3 and Jaeger
propagation (
Propagators), sampling (Sampler), a SERVER span per exchange and a CLIENT span per attempt to reach
the server, INTERNAL spans for tunnels and flows, and OTLP/HTTP export of traces, metrics (the
proxy's StatsRegistry) and access logs, as protobuf or JSON (Telemetry).-
Uses of FlowContext in org.microproxy
Subclasses of FlowContext in org.microproxyModifier and TypeClassDescriptionclassAFlowContextthat also knows the server side of the flow.Fields in org.microproxy declared as FlowContextModifier and TypeFieldDescriptionprotected final FlowContextHttpFiltersAdapter.flowContextThe client connection or exchange context.Methods in org.microproxy that return FlowContextModifier and TypeMethodDescriptionFlowRecord.context()Returns the client's context of the exchange or flow.FullFlowContext.getClientContext()Returns the client-side context this server-side view was made from.FlowContext.getConnectionContext()The context of the client connection this flow belongs to: this context itself (or the one it was made from) for HTTP/1, the connection's own for an HTTP/2 stream's.Methods in org.microproxy with parameters of type FlowContextModifier and TypeMethodDescriptiondefault AuthResultProxyAuthenticator.authenticate(HttpRequest request, FlowContext flow) Decides whetherrequestmay proceed, and as which user.static FlowRecord.BuilderFlowRecord.builder(FlowContext context, FlowRecord.Kind kind) Starts a record of an exchange or flow oncontext.default voidActivityTracker.bytesReceivedFromClient(FlowContext flowContext, int numberOfBytes) Called after bytes are read from the client.default voidActivityTracker.bytesSentToClient(FlowContext flowContext, int numberOfBytes) Called after bytes are written to the client.default voidActivityTracker.clientConnected(FlowContext flowContext) Called when the proxy accepts a client connection.default voidActivityTracker.clientDisconnected(FlowContext flowContext, SSLSession sslSession) Called when the client connection closes.default SSLContextMitmManager.clientSslContextFor(HttpRequest connectRequest, SSLSession serverSslSession, FlowContext flow) TLS configuration presented to the client connectionflow, e.g. with a certificate from that client's CA.default voidActivityTracker.clientSSLHandshakeStarted(FlowContext flowContext) Called before the TLS handshake with the client starts.default voidActivityTracker.clientSSLHandshakeSucceeded(FlowContext flowContext, SSLSession sslSession) Called after the TLS handshake with the client succeeds.default voidMitmManager.configureServerSocket(SSLSocket socket, FlowContext flow) Customizes the socket to the real server for the client connectionflow.default voidActivityTracker.connectionExceptionCaught(FlowContext flowContext, Throwable cause) Called when something failed on the client side of a flow: client I/O errors, and unexpected exceptions while serving the connection (which is then closed).default voidActivityTracker.connectionTimedOut(FlowContext flowContext) Called when the client connection reaches its idle timeout.HttpFiltersBuilder.Built.filterRequest(HttpRequest originalRequest, FlowContext flowContext) These filters, for any request.HttpFiltersChain.filterRequest(HttpRequest originalRequest, FlowContext flowContext) HttpFiltersSource.filterRequest(HttpRequest originalRequest, FlowContext flowContext) Returns the filters for a request, ornullto proxy it unfiltered.HttpFiltersSourceAdapter.filterRequest(HttpRequest originalRequest, FlowContext flowContext) default MitmManagerMitmManager.forConnection(FlowContext flow) The manager that intercepts for the client connectionflow; this one by default.default voidScriptCallObserver.onCallEnd(Object token, String hook, String script, FlowContext flow, long steps, long allocBytes, long nanos, String budgetExceeded, Throwable error) A call has ended.default ObjectScriptCallObserver.onCallStart(String hook, String script, FlowContext flow) A call is starting.default voidActivityTracker.requestReceivedFromClient(FlowContext flowContext, HttpRequest httpRequest) Called when a request head arrives from the client.default voidActivityTracker.responseCompleted(FlowContext flowContext, HttpResponse httpResponse) Called when the whole response to a request, body included, has been written to the client (for aCONNECTor a protocol upgrade: once the response head has, before the tunnel starts).default voidActivityTracker.responseSentToClient(FlowContext flowContext, HttpResponse httpResponse) Called when a response head is sent to the client.default voidActivityTracker.responseSentToClient(FlowContext flowContext, HttpResponse httpResponse, ResponseSource source) Called when a response head has been sent to the client, with where the response came from.default SSLContextMitmManager.serverSslContext(String peerHost, int peerPort, FlowContext flow) TLS configuration for the proxy's connection to the real server, for the client connectionflow: the trust store servers are validated against, and the key the proxy authenticates with when a server asks for a client certificate.default X509TrustManagerMitmManager.serverTrustManager(String peerHost, int peerPort, FlowContext flow) How servers are validated where the proxy's TLS is not the JDK's: on QUIC connections to HTTP/3 servers (HttpProxyServerBootstrap.withHttp3Upstream(boolean)).default booleanMitmManager.shouldIntercept(ClientHello clientHello, FlowContext flow) Whether to intercept a TLS connection, once its client'sClientHellois known: return false to tunnel it untouched, so the client sees the real server's certificate.FlowTracer.startExchange(FlowContext flow, HttpRequest request) Called when a request head arrives from the client, before trackers, authentication and filters see it, so that headers the tracer adds (anX-Request-Id) are seen by all of them and the access log.default voidActivityTracker.tlsHandshakeFailed(FlowContext flowContext, boolean clientSide, Throwable cause) Called when a TLS handshake failed or timed out, before the failure is handled.default voidActivityTracker.transparentQuicFlowDecided(FlowContext flowContext, ClientHello clientHello, boolean intercepted, String reason) Called when the transparent QUIC listener (HttpProxyServerBootstrap.withTransparentQuicPort(int)) has decided what to do with a new client flow, from its ClientHello: intercept it (its HTTP/3 requests then come as for any client), or relay its datagrams to the server untouched.Method parameters in org.microproxy with type arguments of type FlowContextModifier and TypeMethodDescriptionstatic MitmManagerMitmManager.perConnection(Function<? super FlowContext, ? extends MitmManager> choose) A manager that letschoosepick the manager for each client connection (seeMitmManager.forConnection(org.microproxy.FlowContext)), e.g. aCertificateAuthorityMitmManagerper tenant with its own CA and upstream trust store.Constructors in org.microproxy with parameters of type FlowContextModifierConstructorDescriptionprotectedFlowContext(FlowContext parent) Creates a context that shares identity and timing data withparent.protectedFlowContext(FlowContext connection, int streamId) Creates the context of one HTTP/2 stream of the client connectionconnection: it shares the connection's identity (id, addresses, TLS session, client details, acceptance time) and has its own exchange record and timing data, since a connection's streams run at the same time.protectedFlowContext(FlowContext connection, int streamId, HttpVersion version) Creates the context of one stream of the client connectionconnection, asFlowContext(FlowContext, int)does, for an HTTP/2 or an HTTP/3 connection.FullFlowContext(FlowContext clientContext, String serverHostAndPort, ChainedProxy chainedProxy, InetSocketAddress remoteAddress) Creates a server-side view of a client exchange.HttpFiltersAdapter(HttpRequest originalRequest, FlowContext flowContext) Creates filters retaining the original request and client context. -
Uses of FlowContext in org.microproxy.cache
Methods in org.microproxy.cache with parameters of type FlowContextModifier and TypeMethodDescriptionHttpCache.filterRequest(HttpRequest originalRequest, FlowContext flowContext) -
Uses of FlowContext in org.microproxy.extras
Methods in org.microproxy.extras that return types with arguments of type FlowContextModifier and TypeMethodDescriptionstatic BiFunction<HttpRequest, FlowContext, String> ConcurrencyLimiter.byClientIp()Keys requests by the client's IP address (the default).static BiFunction<HttpRequest, FlowContext, String> ConcurrencyLimiter.byTargetHost()Keys requests by the host they go to, lower-cased and without the port: theCONNECTtarget, the absolute URI's host, or theHostheader (inside intercepted sessions).static BiFunction<HttpRequest, FlowContext, String> ConcurrencyLimiter.byUser()Keys requests by the authenticated user (flow.getClientDetails().getUserName()), or by the client's IP address for clients that did not authenticate.Methods in org.microproxy.extras with parameters of type FlowContextModifier and TypeMethodDescriptionAntiCache.filterRequest(HttpRequest originalRequest, FlowContext flowContext) BlockList.filterRequest(HttpRequest originalRequest, FlowContext flowContext) ConcurrencyLimiter.filterRequest(HttpRequest originalRequest, FlowContext flowContext) HarRecorder.filterRequest(HttpRequest originalRequest, FlowContext flowContext) HttpLogger.filterRequest(HttpRequest originalRequest, FlowContext flowContext) Filters that log this exchange, ornullwhen it is not logged: theHttpLogger.Builder.onlypredicate declined it, or the defaultSystem.Loggeris off at INFO.MapLocal.filterRequest(HttpRequest originalRequest, FlowContext flowContext) MapRemote.filterRequest(HttpRequest originalRequest, FlowContext flowContext) ModifyBody.filterRequest(HttpRequest originalRequest, FlowContext flowContext) ModifyHeaders.filterRequest(HttpRequest originalRequest, FlowContext flowContext) RewriteRules.filterRequest(HttpRequest originalRequest, FlowContext flowContext) ServerReplay.filterRequest(HttpRequest originalRequest, FlowContext flowContext) StickyCookie.filterRequest(HttpRequest originalRequest, FlowContext flowContext) voidConcurrencyLimiter.RejectListener.rejected(String key, HttpRequest request, FlowContext flow) Called when a request exceeds its concurrency limit.ConcurrencyLimiter.Responder.respond(String key, HttpRequest request, FlowContext flow) Creates the HTTP response for a refused request.Method parameters in org.microproxy.extras with type arguments of type FlowContextModifier and TypeMethodDescriptionConcurrencyLimiter.Builder.key(BiFunction<HttpRequest, FlowContext, String> key) What requests are counted by: the client's IP address by default (ConcurrencyLimiter.byClientIp()), orConcurrencyLimiter.byUser(),ConcurrencyLimiter.byTargetHost()or any function of the request head and client connection.HttpLogger.Builder.only(BiPredicate<HttpRequest, FlowContext> predicate) Logs only the exchanges whose request (as the client sent it) matches. -
Uses of FlowContext in org.microproxy.frames
Methods in org.microproxy.frames that return FlowContextModifier and TypeMethodDescriptionFrameContext.flowContext()The exchange the frame belongs to, or null for connection frames and for frames that come before their exchange exists: the HEADERS that open an HTTP/2 stream from a client, and frames anHttp3FramePipelineruns. -
Uses of FlowContext in org.microproxy.otel
Methods in org.microproxy.otel with parameters of type FlowContext -
Uses of FlowContext in org.microproxy.quic
Methods in org.microproxy.quic that return FlowContextModifier and TypeMethodDescriptionQuicContext.flowContext()The flow of theCONNECTthe proxy made up to decide on the connection. -
Uses of FlowContext in org.microproxy.starlark
Methods in org.microproxy.starlark with parameters of type FlowContextModifier and TypeMethodDescriptionScriptedProxy.authenticate(HttpRequest request, FlowContext flow) Calls the script'sauthenticate(req, ctx).StarlarkScript.call(FlowContext flow, String function, org.microproxy.thirdparty.starlark.eval.Mutability mu, Object... args) Callsfunctionwithargsfor the exchangeflow.ScriptedProxy.filterRequest(HttpRequest originalRequest, FlowContext flowContext) -
Uses of FlowContext in org.microproxy.tcp
Methods in org.microproxy.tcp that return FlowContextModifier and TypeMethodDescriptionTcpContext.flowContext()The exchange that opened the tunnel (itsCONNECT), or the client connection's flow. -
Uses of FlowContext in org.microproxy.udp
Methods in org.microproxy.udp that return FlowContextModifier and TypeMethodDescriptionUdpContext.flowContext()The exchange that opened the flow (its CONNECT-UDP request, on its own HTTP/3 stream). -
Uses of FlowContext in org.microproxy.warc
Methods in org.microproxy.warc with parameters of type FlowContextModifier and TypeMethodDescriptionWarcRecorder.filterRequest(HttpRequest originalRequest, FlowContext flowContext)