Microsoft provides a method as part of WinHTTP that allows the user to determine which proxy should be used for any given URL. It is called WinHttpGetProxyForUrl .
Unfortunately, I program in python, so I canβt access this function directly - I can use Win32COM to call any Microsoft service using the COM interface.
So, is there a way to access this function from Python? As an additional problem, I cannot add anything but Python to the project. This means that, however, it is not possible to add corrections in C # or C ++.
I am 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)
proxy = win32inet.WinHttpGetProxyForUrl( hinternet, u"http://www.foo.com", 0 )
Obviously, the last line is incorrect, however I do not see any documents or examples on the right path!
Update 1:
I am going to ask this again as a new question, since now we are talking about win32com .
source
share