• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to change the system proxy configuration ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to change the system proxy configuration ?


  • Subject: Re: How to change the system proxy configuration ?
  • From: Jaime Magiera <email@hidden>
  • Date: Mon, 25 Aug 2008 01:30:49 -0400


On Aug 24, 2008, at 10:31 PM, Andy wrote:

Hi, all

I want to change the system proxy configuration with my app. But I
failed, my code follows below.
Anyone could give me some suggestions or point out  some problems in
this code will be appreciated.
Thanks for your time.

Hi,

Is there a missing email or two in this story? The last email I saw was Quinn responding that more information was need before pointing you in the right direction. The thread was interesting. So, I was watching to learn. Did you receive Quinn's message? (if not, it's below). One thing that seems to be tricky with the SCPreferences (and scutil I guess) is that you can change either the permanent prefs storage or the temporary prefs storage (which is wiped when configd reloads). Network preferences can also be changed with the networksetup command. So, maybe the right way to modify the settings depends on what your application does. In terms of your specific question, the paths in SCPreferences are a little different that what you see using scutil. In particular, the root is...

keys (
    NetworkServices,
    VirtualNetworkInterfaces,
    System,
    CurrentSet,
    Sets
)

Dig deeper into the tree to find your way. Just run SCPreferencesPathGetValue with a path of "/" and output to console to see the entire tree.

hope that helps, but again, this may not be the way. It really depends on what Quinn suggests is right for your goal. (copied below)

Jaime

Begin forwarded message:

From: Quinn <email@hidden>
Date: August 22, 2008 6:29:01 AM GMT-04:00
To: email@hidden
Subject: Re: What is the "preference path" in "SCPreferencesPathGetValue" ?


At 17:52 +0800 22/8/08, Andy wrote:
In my code, I use the function "CFDictionaryRef
SCPreferencesPathGetValue ( SCPreferencesRef prefs, CFStringRef path
)" to get a dictionary for a system proxy configuration, my "path"
string is "/Networkservice/0/Proxies", but it returns NULL, so what is
the correct path string, is it only an absolute path string ?
My Mac OS X version is 10.5.3

Mac OS X has a whole bunch of different APIs for managing proxy preferences, and you might be better off using one of the more high- level APIs. If you post a short description of your high-level goal, I should be able to advise you as to the best way to proceed.


S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/ >
Apple Developer Relations, Developer Technical Support, Core OS/ Hardware
_______________________________________________
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >How to change the system proxy configuration ? (From: Andy <email@hidden>)

  • Prev by Date: How to change the system proxy configuration ?
  • Next by Date: Adding Network Interfaces + System Config APIs
  • Previous by thread: How to change the system proxy configuration ?
  • Next by thread: Re: How to change the system proxy configuration ?
  • Index(es):
    • Date
    • Thread