How can I get the resolved IP address from a nw_connection?
I tried using:
But that just returns the same endpoint that I provided (which was a URL + port), when I want the resolved IP address that was actually connected to.
With CFStreams I'd have gotten the file descriptor and then called getpeername().
I looked into nw_resolver_t, but that just seems to be for specifying a DoH or DoT resolver, which isn't what I want.
I tried using:
Code Block objective-c nw_endpoint_t endpoint = nw_path_copy_effective_remote_endpoint(nw_connection_copy_current_path(connection));
But that just returns the same endpoint that I provided (which was a URL + port), when I want the resolved IP address that was actually connected to.
With CFStreams I'd have gotten the file descriptor and then called getpeername().
I looked into nw_resolver_t, but that just seems to be for specifying a DoH or DoT resolver, which isn't what I want.