cboles
26th November 2014, 23:06
I'm sending a request to a virtual server using QUrl / QHttp that is of the form
http://www.myserver.com/path/request.php?var1=x&var2=y
and this is working fine. For certain tests we would like to not use a DNS server and instead hard-code the DNS entry of www.myserver.com to an IPv4 address of our choosing. I know I can do this with a hosts file entry, but I would like to do this only within my app and not affect the rest of the OS. Further, because the virtual server wants to see the correct hostname in the URL, I can't simply make a request like this:
http://1.2.3.4/path/request.php?var1=x&var2=y
I haven't gone through the QtNetwork source yet, but I'm wondering if there is a way to specify an "internal" DNS provider or internal hosts mapping so that it does not go through the whole network stack to make these DNS lookups and still has the hostname in the URL, all the while having this only affect a single instance of my app?
http://www.myserver.com/path/request.php?var1=x&var2=y
and this is working fine. For certain tests we would like to not use a DNS server and instead hard-code the DNS entry of www.myserver.com to an IPv4 address of our choosing. I know I can do this with a hosts file entry, but I would like to do this only within my app and not affect the rest of the OS. Further, because the virtual server wants to see the correct hostname in the URL, I can't simply make a request like this:
http://1.2.3.4/path/request.php?var1=x&var2=y
I haven't gone through the QtNetwork source yet, but I'm wondering if there is a way to specify an "internal" DNS provider or internal hosts mapping so that it does not go through the whole network stack to make these DNS lookups and still has the hostname in the URL, all the while having this only affect a single instance of my app?