문제

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...

도움이 되었습니까?

해결책 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).

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top