i'd love to see that and would highly recommend using libproxy for this task. It offers for you that you do not have to care for the entire 'which proxy to use', supports pac file and proxy autodetections (wpad) and even it does not bind you to read 'gnome proxy settings': in case the app runs in a kde session, the kde settings are being read... (and on windows it reads the windows settings btw).