Tuesday 15 March 2011

Parse PAC files in Python without using C modules -



Parse PAC files in Python without using C modules -

i in sticky situation cannot utilize pacparser library, , hoping had pure python solution (no c/c++ modules).

i have pac file has multiple proxies returned:

function findproxyforurl(url,host) { if (isplainhostname(host)) { homecoming "direct"; } #// internal network hosts  if (isinnet(host, "158.232.0.0", "255.255.0.0") || isinnet(host, "127.0.0.1", "255.255.255.255")|| isinnet(host, "10.0.0.0", "255.0.0.0")) { homecoming "direct"; } #// connect through proxy server other hosts. if proxy server not available, connect straight homecoming "proxy proxy.site.com:3128; proxy proxy02.site.com:3128; proxy proxy05.site.com:3128; proxy proxy03.site.com:3128; proxy proxy04.site.com:3128"; }

how can parse using python , best way tell proxy up?

thank , consideration academy! :)

python python-2.7 pac

No comments:

Post a Comment