Answer the question
In order to leave comments, you need to log in
Why doesn't the code for tunneling traffic through SSH work?
Wrote a little code:
const QString ssh_agent = "plink.exe";
QWebView *window = new QWebView(this);
QProcess *plink = new QProcess(window);
QNetworkAccessManager *web_manager = new QNetworkAccessManager(window);
plink->start(ssh_agent+" -ssh 1.1.1.1 -C -N -l root -pw 111 -D 127.0.0.1:62500");
QNetworkProxy proxy;
proxy.setHostName("127.0.0.1");
proxy.setPort(62500);
proxy.setCapabilities(QNetworkProxy::TunnelingCapability);
proxy.setType(QNetworkProxy::Socks5Proxy);
web_manager->setProxy(proxy);
window->setGeometry(0,0,1280,960);
window->load(QUrl("http://2ip.ru/"));
window->page()->setNetworkAccessManager(web_manager);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question