PDA

View Full Version : How to use anonimous proxy with QWebFrame.load



avastreg
25th March 2011, 08:50
Hi to all,

i'm new to the forum and i'm a PyQt user.

My question is pretty conceptual, i need just an hint because i'm stuck on that.

I want to fetch an URL with QWebPage passing by a web anonimous proxy.

Using directly QWebPage.mainFrame().load(QUrl) works without problems.

If I try to set proxy with these methods (it's python but it's pretty easy to understand for C++ users ;)):



#setting up the proxy

proxy = QNetworkProxy()
proxy.setHostName("189.75.98.199") #just examples
proxy.setPort(1111)
proxy.setType = QNetworkProxy.HttpProxy

#setting the manager

manager = QNetworkAccessManager()
manager.setProxy(proxy) #setting the proxy on the manager

#setting the proxy as application proxy

QNetworkProxy.setApplicationProxy(proxy) #seems to do nothing..

#web page

webpage = QWebPage()
webpage.setNetworkAccessManager(manager) #maybe.. but it doesn't work

webpage.mainFrame().load(QUrl("http://www.foo.bar") )

the QWebPage does the request ignoring my proxy, always directly.

What's wrong? I'm using in a wrong way my proxy? Or is it a conceptual problem?


Thanks

avastreg
25th March 2011, 15:39
nobody? is it possible with an anonimous proxy?