Getting IP Address or CFStream from NSURLConnection / NSURLRequest

I am trying to get the base socket / stream or IP address from NSURLConnection when the request starts sending a response. I could not find a way to get the underlying low-level stream from the active request (which then easily allows me to get IP information).

In this case, it is used to record the exact IP address used for the debug log since the host name in the URL request can return many different IP addresses from the load balancer.

I understand that this is a higher level API than regular sockets, and I am considering resolving concurrent DNS for the same host name as a workaround, but it still does not guarantee that DNS resolution will return the same IP address. which was used for this request.

Thanks in advance for your help!

+4
source share

Source: https://habr.com/ru/post/1539704/


All Articles