SCNetworkReachability not checking proxy settings in firewalled environment
SCNetworkReachability not checking proxy settings in firewalled environment
- Subject: SCNetworkReachability not checking proxy settings in firewalled environment
- From: Jens Alfke <email@hidden>
- Date: Thu, 22 May 2014 11:34:21 -0700
I’ve written a library that does some fairly complex operations talking to a server via a REST API. I use SCNetworkReachabilityCreateWithName[1] to sign up for notifications when the server becomes reachable, so I’ll know when to kick off this task.
I’ve just gotten a report that this doesn’t work correctly in a particular corporate network. Apparently the entire LAN is firewalled from the outside world, with no external IP addresses directly reachable, and all outside access has to go through an HTTP proxy. (Of some sort; I’m waiting to hear exactly what it is.) In this environment my library never gets notified that the server is reachable so it never kicks off the task. But the device’s proxy settings are correctly configured, so if I _did_ try to connect to the server, it would work.
I suppose I had been assuming that SCNetworkReachability took proxies into account, i.e. if example.com isn’t directly reachable, but there is a proxy in place and the proxy is reachable, then the host should be treated as reachable. Perhaps this was too naïve?
So is the workaround for me to also use the SystemConfiguration framework to watch for proxy setting changes, and when a proxy is configured start up another observer for the proxy’s reachability? Is there any code out there that shows how to do this? (I have to confess that I’m kind of a noob when it comes to proxies, partly because I’ve almost never worked on a network that uses them.)
—Jens
[1]: Here’s my code: https://github.com/couchbase/couchbase-lite-ios/blob/master/Source/CBLReachability.m
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden