Captive portal detection in QT 4.6
Does anyone know how to detect a guest network as a captive portal. I mean can i detect a network as a CAPTIVE PORTAL.
After doing some digging and trying different captive portals, it seems that they all work differently... some of them do DNS trick(DNS responds with same IP address for any query), some of them just do some kind of transparent http proxy magic probably using squid or packet level forwarding/redirecting (like one could do with iptables) so that no matter what the URL you're presented with the login screen, and in such cases, DNS queries will be answered with correct IP address, but connecting to开发者_如何学Python port 80 on that host name will result in you being redirected to login page...
I tried this idea but no luck!
Is there any way to detect a network as hotspot(captive portal) where http login is required???
Thanks in advance Puneet
The Apple solution is to GET http://www.apple.com/library/test/success.html - if it's not successful assume a captive portal and launch the web browser. You could try something similar if you can set up a server, and launch a QWebView in the case of failure.
精彩评论