Package org.mockserver.netty.proxy
Class TransparentProxyInitializer
java.lang.Object
org.mockserver.netty.proxy.TransparentProxyInitializer
Utility for transparent HTTP proxy mode — provides Host-header parsing helpers
and an
isEnabled() configuration check.
Production path: The actual original-destination resolution and
channel attribute setup is performed by TransparentProxyHandler, which
fires on channelActive and writes the REMOTE_SOCKET attribute
consumed by the forward path. This class provides supplementary Host-header
parsing utilities.
-
Constructor Summary
ConstructorsConstructorDescriptionTransparentProxyInitializer(Configuration configuration, MockServerLogger logger) -
Method Summary
Modifier and TypeMethodDescriptionbooleanresolveTargetHost(String hostHeader) Returns the forwarding host for a transparent proxy request.intresolveTargetPort(String hostHeader, boolean secure) Returns the forwarding port for a transparent proxy request.
-
Constructor Details
-
TransparentProxyInitializer
-
-
Method Details
-
isEnabled
public boolean isEnabled() -
resolveTargetHost
Returns the forwarding host for a transparent proxy request. In transparent proxy mode, the Host header is the target.- Parameters:
hostHeader- the Host header value from the incoming request- Returns:
- the target hostname, or null if the header is empty
-
resolveTargetPort
Returns the forwarding port for a transparent proxy request.- Parameters:
hostHeader- the Host header value from the incoming requestsecure- whether the connection is TLS- Returns:
- the target port
-