IP merge with QWebView (Qt / C ++)

Let's see if you can shed light on my problem. [ C ++ with Qt 5.2 using Qt Creator ]

Situation: Ive got a PC with several local IP addresses assigned to the same interface (IP aliases). The router has different configurations regarding bandwidth, NAT, connections, etc. For each local IP address. Im integrates this local IP switching into some Qt applications, in particular into an application that offers a pleasant viewing experience using QWebView .

What I need: to change which local IP QWebView uses to receive its requests.

The only thing I managed to do was just a patch - use STUNNEL to map localhost ports to remote hosts through different local IP addresses, and using QNetworkProxy use QWebView to use these localhost ports as a proxy. The fact is that for some reason the proxy server seems to be creating some problems: the user cannot see several YouTuve videos, but only sees a static background and "An error has occurred." This does not happen when using NetworkProxyFactory :: setUseSystemConfiguration (true) , since each video can be seen perfectly.

Question: How can I manage IP aliases using Qt? If this is not possible, do you have any ideas why the proxy server through STUNNEL is not working? Maybe another transparent tunneling software to try?

Inputs are rated. Thanks in advance!

+7
c ++ qt qtwebkit qwebview qtnetwork
source share
1 answer

QWebView using QNetworkAccessManager to process requests / responses. Only useful thing you can redefine is virtual

QNetworkReply * QNetworkAccessManager::createRequest(Operation op, const QNetworkRequest & req, QIODevice * outgoingData = 0) [virtual protected] 

which, unfortunately, is not very useful for your purposes.

Also, I don't think the carrier thing will work either.

So, depending on how bad you need this functionality, I would consider making changes to the QNetworkAccessManager to be able to pass a list of allowed interfaces / IP addresses, so QTcpSocket will bind itself to the specified IP address .. and then set this to AccessManager for webview.

As far as I know, specifying a binding address is not supported for QNetworkAccessManager

+2
source share

All Articles