[Qgis-developer] http proxy support

Tim Sutton tim at linfiniti.com
Fri Aug 15 14:31:18 EDT 2008


Hi

2008/8/15 Barry Rowlingson <b.rowlingson at lancaster.ac.uk>:
> I can't get the python plugin installer to punch through our web proxy server.
>
> There's code in Qgis to set a proxy host/port in the Options menu, but
> this calls QNetworkProxy.setApplicationProxy(...) which seems to
> concern itself with application-level proxying which I think is what
> SOCKS is all about. This doesn't do HTTP proxying.

No setApplicationProxy as I have written it in qgisapp is for http
proxying not socks and as far as I know its working for proxy users
using e.g. wms plugin, wfs plugin etc.

http://www.riverbankcomputing.co.uk/static/Docs/PyQt4/html/qnetworkproxy.html
has some examples and further explanation.

-------------8<---------snip--------------------

>    proxy = QNetworkProxy()
>    proxy.setType(QNetworkProxy.HttpProxy)
>    proxy.setHostName("wwwcache.lancs.ac.uk")
>    proxy.setPort(8080)
>
>    QNetworkProxy.setApplicationProxy(proxy)
>
>    app = QCoreApplication (sys.argv)
>    page = QHttp(None)
>    #page.setProxy(proxy)
>    QObject.connect(page, SIGNAL("done(bool)"), process);
>    page.setHost('trolltech.com')
>    gprocId = page.get('/')
>    sys.exit (app.exec_ ())
>

Shouldnt you create your app first, and then set the application
proxy? Just a thought....

---------8<-------snip----------------


> This seems to be the only way to do http proxying in Qt. Looks like
> you have to set it for each QHttp transfer, which is not nice.

Ya its not nice which is why I implemented the application wide proxy rather.

>
>  Or possibly I'm just having a bad Friday..


I dont have any hard evidence, but perhaps the issue is caused by the
python bindings across the plugin interface rather than the set
applicationproxy per se. It would be interesting if you tried from
within your python plugin to getApplicationProxy and see if it matches
the settings you gave in qgs options....

-------8<--------snip------------


Regards

Tim



>
>  Barry
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>



-- 
Tim Sutton
QGIS Project Steering Committee Member - Release Manager
Visit http://qgis.org for a great open source GIS
Blog: http://tim.linfiniti.com
Skype: timlinux
Irc: timlinux on #qgis at freenode.net


More information about the Qgis-developer mailing list