开发者

Find out the Proxies WPAD is returning

开发者 https://www.devze.com 2023-01-20 04:44 出处:网络
our organization uses the WPAD method for setting proxies in IE . Is there a way to actually find out开发者_开发知识库 the actual proxy IE is using for a URL ? . i need this to manually set up the pro

our organization uses the WPAD method for setting proxies in IE . Is there a way to actually find out开发者_开发知识库 the actual proxy IE is using for a URL ? . i need this to manually set up the proxy and not use the WPAD option .

Any help is appreciated .

Thanks and Regards


As Rumplin summarises you can retrieve the files which Internet Explorer uses to discover which (if any) proxy to use for a particular URL. Then you can read through those files to work it out yourself. The Wikipedia explanation of proxy auto-config files can help you understand the JavaScript function.

Something I've just come across which does the parsing bit for you is pacparser. It provides a parsing library for C or Python and the example given to do what you're asking in Python looks ridiculously easy.

>>> import pacparser
>>> pacparser.init()
>>> pacparser.parse_pac_file('examples/wpad.dat')
>>> pacparser.find_proxy('http://www.google.com', 'www.google.com')
'PROXY proxy1.manugarg.com:3128; PROXY proxy2.manugarg.com:3128; DIRECT'
>>> pacparser.find_proxy('http://www2.manugarg.com', 'www2.manugarg.com')
'DIRECT'
>>> pacparser.cleanup()
>>>


Try

http://wpad.department.branch.example.com/wpad.dat

http://wpad.branch.example.com/wpad.dat

http://wpad.example.com/wpad.dat

where example.com is your intranet domain.

0

精彩评论

暂无评论...
验证码 换一张
取 消