Microsoft provides a method as part of WinHTTP which allows a user to determine which Proxy ought to be used for any given URL. It's called WinHttpGetProxyForUrl.
Unfortunately I'm programming in python so I cannot directly access this function - I can use Win32COM to call any Microsoft service with a COM interface.
So is there any way to get access to this function from Python? As an additional problem I'm not able to add anything other than Python to the project. That means however convenient it is impossible to add C# or C++ fixes.
I'm running Python2.4.4 with Win32 extensions on Windows XP.
Update 0:
This is what I have so far:
import win32inet
import pprint
hinternet = win32inet.InternetOpen("foo 1.0", 0, "", "", 0)
# Does not work!!!
proxy = win32inet.WinHttpGetProxyForUrl( hinternet, u"http://www.foo.com", 0 )
Obviously the last line is wrong, however I cannot see any docs or examples on the right way to do it!
Update 1:
I'm going to re-ask this as a new question since it's now really about win32com.