views:

178

answers:

1

Hello all!

Has anyone here used Libproxy library? If I am to make an application to resolve proxy settings by reading proxy.pac from a remote server, would libproxy help me with that? Any ideas on how to use libproxy to download pac scripts and get the proxy values?

Thanks!

GK

A: 

Libproxy handles the pac downloading and parsing transparently for you.

What your app should to: Create a new ProxyFactory object pf = New ProxyFactory()

For every resource you connect to, check which proxies to use ProxiesToTry=pf.getProxies("http://www.google.com") (for every URI you connect! Especially with PAC this can be different per URI, like offloading pictures or videos and the like).

[...] connect to the proxy and do your communication

destroy pf object.

As long as the pf object is lying around, the pac file is being cached.

For futher info, feel free to join the devs on #libproxy on freenode (IRC)