Skip to content

HttpConnector::set_local_address doesn't allow to specify both v4 and v6 IPs #2169

Closed
@inikulin

Description

@inikulin

Currently HttpConnector::set_local_address method accepts a single argument. Server might not support IPv6 or IPv4.

Therefore, the only solution at the moment is to manually perform DNS resolution and pick appropriate local address family. This is inefficient, as leads to 2 DNS lookups per request.

I'm working on a PR that addresses this issue. I plan to introduce pub fn set_local_addresses(&mut self, addr_v4: Option<Ipv4Addr>, addr_v6: Option<Ipv6Addr>) and deprecate set_local_address method. Or I can change signature of set_local_address if you're OK with breaking changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions