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

chrislhardin

macrumors newbie
Original poster
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😡"-setwebproxy", @"Airport", host, [NSString stringWithFormat😡"%d", port], nil]];
} else {
[task setArguments:[NSArray arrayWithObjects😡"-setwebproxystate", @"Airport", @"on", nil]];

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