How to build "Auto Detect Proxy Settings" In Windows and in Mac
What are the steps to implement that feature in 1) Windows and 2) in Mac? I went through these, still I am not very clear! I am using C/C++ in Windows and in Mac. So, Win API or Mac API will be enough.
I am also confused because Mac Firefox has also has a option "Use system proxy settings", which is not present in Windows Firefox.
These are some similar questions:
LINK-1: Programmatically detect system-proxy settings on Windows XP with Python
LINK-2: How does Windows actually detect LAN (proxy) settings when using Automatic Configuration
According the this Wiki WPAD article, we should traverse in this sequence:
- http://wpad.branch.example.com/wpad.dat
- http://wpad.example.com/wpad.dat 开发者_如何学JAVA
- http://wpad.com/wpad.dat
But LINK-1 says "GET http://wpad/wpad.dat
" is enough. Which one should I follow?
I using librproxy. That solved this requirement.
On Mac you use SCDynamicStoreCopyProxies(NULL)
and query the resulting dictionary for the information you need. See QA1234 for an example.
On Windows the linked questions should get you where you need. You might want to add where you got stuck.
精彩评论