Turn Http Proxy on and Off in Objective C

Discussion in 'Mac Programming' started by chrislhardin, Mar 17, 2011.

  1. chrislhardin macrumors newbie

    Joined:
    Mar 17, 2011
    #1
    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"];
     
  2. ccamelot macrumors member

    ccamelot

    Joined:
    Feb 21, 2010
    Location:
    Poland
    #2
    Study MoreSCF from Apple Dev website

    Hi,
    I think MoreSCF sample code can be helpful.

    Les
     

Share This Page