4

I'm trying to get the underlying socket/stream or the IP address from a NSURLConnection as the request starts transmitting a response. I haven't been able to find a way to get the underlying lower level stream from an active request (which would then easily allow me to get the IP information).

The use case for this is to record the exact IP used to a debug log since the hostname in the URL request can return many different IPs from the load balancer.

I recognize that these are higher level APIs than plain sockets and I'm considering doing a parallel DNS resolve for the same hostname as a workaround, but that still doesn't gurantee that the DNS resolution will return the same IP that was used for the request in question.

Thanks in advance for the help!

Michael Petrov
  • 2,247
  • 15
  • 15

0 Answers0