Форум сайта python.su
Подскажите как реализовать soks5 в pyqtwebkit
Делаю так
#!/usr/bin/env python
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
# Some of the PyQt libs
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
from PyQt4.QtNetwork import *
def onLoadFinished(result):
print "result - " + str(result)
sys.exit(0)
manager = QNetworkAccessManager()
proxy = QNetworkProxy()
proxy.setHostName("123.123.123.123")
proxy.setPort(123)
proxy.setType(proxy.Socks5Proxy)
manager.setProxy(proxy)
app = QApplication(sys.argv)
webpage = QWebPage()
webpage.setNetworkAccessManager(manager)
webpage.connect(webpage, SIGNAL("loadFinished(bool)"), onLoadFinished)
webpage.mainFrame().load(QUrl("http://2ip.ru"))
#webpage.mainFrame().load(QUrl("http://188.40.74.10"))
sys.exit(app.exec_())
webpage.mainFrame().load(QUrl("http://188.40.74.10"))
Отредактировано (Окт. 28, 2011 17:12:21)
Офлайн