Skip to content

Instantly share code, notes, and snippets.

@snaggled
Created June 24, 2015 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snaggled/07e6fbc22c5aa8b3ee11 to your computer and use it in GitHub Desktop.
Save snaggled/07e6fbc22c5aa8b3ee11 to your computer and use it in GitHub Desktop.
NSString* proxyHost = @"localhost";
NSNumber* proxyPort = [NSNumber numberWithInt: 8888];
// Create an NSURLSessionConfiguration that uses the proxy
NSDictionary *proxyDict = @{
@"HTTPEnable" : [NSNumber numberWithInt:1],
(NSString *)kCFStreamPropertyHTTPProxyHost : proxyHost,
(NSString *)kCFStreamPropertyHTTPProxyPort : proxyPort,
@"HTTPSEnable" : [NSNumber numberWithInt:1],
(NSString *)kCFStreamPropertyHTTPSProxyHost : proxyHost,
(NSString *)kCFStreamPropertyHTTPSProxyPort : proxyPort,
};
configuration.connectionProxyDictionary = proxyDict;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment