As Apple introduce extension support in Safari 5, I want to make an extension that manage proxy settings directly in the browser (like AutoProxy for Firefox or Proxy Switchy for Chrome).

I skimmed the source code of Proxy Switchy. It is mainly written in Javascript/HTML, but uses an external binary bundle to do proxy switching. Is this scheme doable in Safari extension? If not, is there other way to manage proxy settings in the extension?