Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chrislhardin

macrumors newbie
Original poster
Mar 17, 2011
1
0
I am currently cheating in a Mac app and setting the HttpProxy like below, but I really want to change this to turn the Proxy on and of programmatically. Does anyone know how I can do this?

if (host != nil) {
NSLog(@"Setting Host and Port. %@:%d", host, port);

[task setArguments:[NSArray arrayWithObjects:mad:"-setwebproxy", @"Airport", host, [NSString stringWithFormat:mad:"%d", port], nil]];
} else {
[task setArguments:[NSArray arrayWithObjects:mad:"-setwebproxystate", @"Airport", @"on", nil]];

}
[delegate notification:mad:"Proxy Enabled" withKey:mad:"Proxy"];
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.