hinzuzufügen, war ich unter dem Eindruck, sollte ich es so konfigurieren, mit einem Wörterbuch wie folgt aus:Wie programm einen Proxy zu einem NSURLSession
// Create a dictionary to describe the proxy
NSDictionary *proxyDict = @{
(NSString *)kCFProxyHostNameKey : @"myProxyHost.com",
(NSString *)kCFProxyPortNumberKey : @"12345",
(NSString *)kCFProxyTypeKey : (NSString*)kCFProxyTypeHTTP
};
// Create a configuration that uses the dictionary
NSURLSessionConfiguration *configuration = [NSURLSessionConfiguration defaultSessionConfiguration];
[configuration setConnectionProxyDictionary:proxyDict];
jedoch die Anforderungen von NSURLSession
erstellt mit dieser Konfiguration direkt verbinden.
Vielen Dank! Eine Million mal danke! Ich hätte das nie herausgefunden. Sicher wäre es schön, wenn Apple das dokumentieren würde. – bugloaf
Vielen Dank! Du bist ein Lebensretter! –
@Jeff - Ich habe es versucht .. Aber die Daten aus '^ (NSData * data, NSURLResponse * response, NSError * error) gibt die Ergebnisse von myProxyHost.com und nicht www.google.com Kann mir helfen –