Hi Jens, hope you're feeling better. That is an excellent summary of the issue, leaving out the change I had to make in order for it to correctly take advantage of the proxy settings (see the patch I linked in a separate email). I also think your proposed solution sounds like the correct one, and one I was planning on attempting to implement if I get a bit more time.
One thing to keep in mind that I learned about when I was debugging is the kCFProxyTypeAutoConfigurationURL type, which isn't a specific proxy host but a URL to a file containing a JavaScript function that will return the proper proxy settings for any given URL. So, when examining the proxy settings I think you need to check for either a URL under the kCFProxyTypeAutoConfigurationURLKey or a hostname under the kCFProxyHostNameKey, and then choose one to use for the reachability check. They certainly don't make this simple. :/ - Ian On Thursday, May 22, 2014 12:18:16 PM UTC-5, Jens Alfke wrote: > > Hi guys, sorry not to chime in earlier but I was out of town all weekend, > and then immediately out sick with a cold :( > > My understanding of the problem is: > > - The device is on a WiFi network that’s firewalled so no outside > hosts are reachable (the router won’t route to any external address > ranges.) > - There is an HTTP proxy server on this network that can be used to > make requests of outside servers. > - The device is aware of the proxy, as evidenced by being able to use > Safari to view outside sites. > - But Couchbase Lite thinks the remote db server is unreachable and > won’t try to replicate. > > > It does sound as though SCNetworkReachability is ignoring the system proxy > settings, which is surprising to me. But maybe that’s because it doesn’t > know what particular protocol I’m going to use to contact the host, so it > can’t assume that an HTTP-only proxy would provide access? > > It sounds like the solution is to have my reachability code check the > system proxy settings and check the reachability of the proxy server > instead if there is one. The confusing aspect of this is that the proxy > settings themselves are probably location-based, since the device can move > between LANs with different proxies, so I probably need a second layer of > notification to find out when the system proxy settings change... > > —Jens > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/98b37438-7238-43f5-8ef5-8e9edf6275d8%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
