Question

TL;DR;
Safari mac OSX browser reaches address fine, iOS simulator gets 407'ed

Long Version
Guys, there's something very wrong here... around the internet i keep reading that the iOS simulator will use the mac OSX proxy settings, but i keep getting a 407 trying to perform my "get" in the simulator, but not from my browser... Whats up with that? am I missing a configuration or something?

In order to better understand the problem i created a app with only a web view and had it go to various know-to-work addresses... none worked... 407'ed all...

Was it helpful?

Solution 2

It is not possible to utilize proxy servers requiring authentication with the iOS Simulator in version 7.0 or later due to increased separation between the host and simulated runtimes (specifically the keychain in this case).

OTHER TIPS

I have the same problem.
The ios simulator of iOS6 could connect successfully through the proxy authentication, but from iOS7, it could not connect through the proxy and ios simulator gets 407 status code.

I also checked the log of the proxy server. A request of user and password for the proxy authentication from ios simulator did not have reached to the proxy server.

So, we deal with this issue by running a local proxy server that is written by ruby like this.

 #!/usr/bin/env ruby
 require 'webrick'
 require 'webrick/httpproxy'
 require 'uri'

 handler = Proc.new() do |req, res|
   # do something
 end

 proxy = WEBrick::HTTPProxyServer.new(
   BindAddress: '0.0.0.0',
   Port: 8080,
   ProxyURI: URI.parse(ENV['http_proxy']),
   ProxyContentHandler: handler)

 Signal.trap('INT') do
   proxy.shutdown
   # it did not shutdown for some reason, so kill the process
   sleep 5
   Process.kill('KILL', $$)
 end

 proxy.start

Before running the proxy server, we set up http_proxy.

However, this method is not a solution essential, so I hope that Apple can resolve this problem immediately.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top