Python proxy support

I need some help guys, and although it’s not the right group for it, I hope you’ll help me anyway.

I’ve been struggling with connecting to the net via proxy in Python. Python has some support for working with proxies, but it doesn’t support proxy autodetection and NTLM proxy authentication that is common in large corporate environments.

In order to overcome those issues, I wrote a Python wrapper for winhttp.dll, the Windows HTTP library that is supposed to work with all types of proxy configurations.

However, there’s a limit to how well I can test this and I need your help.
Could you run the attached httplib.py script and let me know what it prints?

It is supposed to autodetect the proxy configuration, connect to http://www.example.com and print its HTML contents.

The script requires Python 2.4 and ctypes or a clean install of Python 2.5.

Thanks!

pywinhttp.zip (13.1 KB)

···


Eli Golovinsky
www.testuff.com

I need some help guys, and although it’s not the right group for it, I hope you’ll help me anyway.

I’ve been struggling with connecting to the net via proxy in Python. Python has some support for working with proxies, but it doesn’t support proxy autodetection and NTLM proxy authentication that is common in large corporate environments.

In order to overcome those issues, I wrote a Python wrapper for winhttp.dll, the Windows HTTP library that is supposed to work with all types of proxy configurations.

However, there’s a limit to how well I can test this and I need your help.
Could you run the attached httplib.py script in th zip and let me know what it prints?

It is supposed to autodetect the proxy configuration, connect to http://www.example.com
and print its HTML contents.

The script requires Python 2.4 and ctypes or a clean install of Python 2.5.

Thanks!

pywinhttp.zip.txt (23.5 KB)

···


Eli Golovinsky
www.testuff.com

Hy guys,
    I've this problem:

I have integrated an IEHtmlWindow activeX object into a wxPanel object.
Well, I set an url to IEHtmlWindow object with LoadUrl() method, and all work ok.
After I have done my operations with html page, I must get result from page, but I don't understand how get these informations.

Have you got any ideas?

thx very much

Mariano Di Felice wrote:

Hy guys,
   I've this problem:

I have integrated an IEHtmlWindow activeX object into a wxPanel object.
Well, I set an url to IEHtmlWindow object with LoadUrl() method, and all work ok.
After I have done my operations with html page, I must get result from page, but I don't understand how get these informations.

Have you got any ideas?

Depends on what you mean by "get result from page". If you mean to get the data values of an HTML form then one way to do that is to run a mini webserver in your app on a private port, and then set the url where the form is submitted to that address.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thx Robin,
    have you some links about it?

Bye

Robin Dunn ha scritto:

···

Mariano Di Felice wrote:

In effects, I have just think about your solution, but I fear of firewalls.
About "get result from page" I mean that I have in this page various code merged in html, javascript and DOM, and finally I must get a result indicated me by javascript function.
This is the reason I've not used wx.HtmlWindow: this object doesn't support javascript.

It probably can't be done with the IE module based on wx.activex, but it might be possible to do it via wx.lib.activexwrapper. Since it uses PyWin32 and has a real COM implementation then you have more control over the embedded objects. So if the IE ActiveX control allows you to get the javascript/DOM info you need via its COM interface then you can probably get to it that way.

--
/\/\ariano Di Felice
Java PHP Python Ruby programmer
with MySQL, PostgreSql, SQLite and Oracle support
Linux Platform Developer
http://www.marianodifelice.it
mariano.difelice@gmail.com
Tel. 0735 703735
Cell +39 339 6407211

Mariano ,

From: Mariano Di Felice [mailto:mariano.difelice@gmail.com]
Sent: Wednesday, February 06, 2008 2:37 AM
To: wxPython-users@lists.wxwidgets.org
Subject: Re: [wxPython-users] activeX wx.lib.iewin.IEHtmlWindow

Thx Robin,
    have you some links about it?

Bye

Robin Dunn ha scritto:
> Mariano Di Felice wrote:
>> In effects, I have just think about your solution, but I fear of
>> firewalls.
>> About "get result from page" I mean that I have in this
page various
>> code merged in html, javascript and DOM, and finally I must get a
>> result indicated me by javascript function.
>> This is the reason I've not used wx.HtmlWindow: this
object doesn't
>> support javascript.
>
> It probably can't be done with the IE module based on
wx.activex, but
> it might be possible to do it via wx.lib.activexwrapper. Since it
> uses PyWin32 and has a real COM implementation then you have more
> control over the embedded objects. So if the IE ActiveX control
> allows you to get the javascript/DOM info you need via its COM
> interface then you can probably get to it that way.
>

I personally recommend the PyWin32 user's group for questions about that
interesting interface:

http://mail.python.org/mailman/listinfo/python-win32

As for links on COM, here's a couple:

http://www.oreilly.com/catalog/pythonwin32/chapter/ch12.html
http://www.boddie.org.uk/python/COM.html

You can usually Google for how to do "something" with Visual Basic and
then translate that into Python. MSDN is your friend as well...at least,
in this situation. You can also Google Robin's suggestion:
"wx.lib.activexwrapper". It returns quite a few hits.

Mike

···

-----Original Message-----