Class DnsIntentOriginalDestinationResolver
- All Implemented Interfaces:
TransparentProxyHandler.OriginalDestinationResolver
DnsIntentRegistry — a record of hostname-to-IP answers
that MockServer's DNS server has handed out.
When this applies: DNS-steering mode. The client resolved a hostname via MockServer's DNS server, received an IP address (A/AAAA record) that routes to MockServer, and connected by IP. This resolver recovers the intended hostname so that expectation matching and forwarding work by name.
Chain position: this resolver runs after the conntrack resolver in the
CompositeOriginalDestinationResolver chain. A real iptables-REDIRECT
original destination (from conntrack or SO_ORIGINAL_DST) always wins; this
resolver only fills the gap when conntrack returns null (e.g., no iptables rule,
or the platform is not Linux).
Unresolved address: this resolver intentionally returns an unresolved
(named) InetSocketAddress via InetSocketAddress.createUnresolved(java.lang.String, int).
Downstream forwarding logic resolves the hostname itself, and MockServer's
existing loop-prevention header guards against a DNS-to-self loop.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DnsIntentOriginalDestinationResolver
public DnsIntentOriginalDestinationResolver()
-
-
Method Details
-
resolve
- Specified by:
resolvein interfaceTransparentProxyHandler.OriginalDestinationResolver- Parameters:
channel- the accepted Netty channel- Returns:
- the original destination, or null if unavailable
-