feat: dial hint on Address for hosts that resolve DNS themselves

This commit is contained in:
randogoth 2026-09-29 12:46:58 +03:00
parent 45987fe03d
commit 5559fcce31
2 changed files with 44 additions and 1 deletions

View file

@ -71,7 +71,15 @@ pub fn connect(
host: addr.host.clone(),
});
}
let transport = TcpTransport::connect(&addr.host, addr.port, pinned, timeout)?;
// The dial hint lets a host that resolves DNS itself (an
// Android app) reach the server by IP while `host` keeps its
// identity roles.
let transport = TcpTransport::connect(
addr.dial.as_deref().unwrap_or(&addr.host),
addr.port,
pinned,
timeout,
)?;
let unpinned_static = if pinned.is_none() {
Some(*transport.server_static())
} else {