feat: dial hint on Address for hosts that resolve DNS themselves
This commit is contained in:
parent
45987fe03d
commit
5559fcce31
2 changed files with 44 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue