Re: Captive portal issues
Posted: Sun Jan 24, 2016 10:00 pm
As far as I've read, sendto is specific to udp. Any reason why you had to remove it? Did it not compile?
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
bjpirt wrote:Hi Sprite_tm and others,
I've been using libesphttpd to good effect and had configured the captive portal which had been working really well until I realised how iOS devices behave. The problem I'm having is that the iPhone thinks that because it can't actually connect to the internet then it should disconnect from the AP (which is just plain annoying).
My suspicion is that they're just not going to play nicely, in which case I'd like to keep the DNS server functionality but only have it respond successfully to one address so that users don't need to type in IP addresses. I've been trying this by making it return an NXDOMAIN error for anything other than my domain but the iOS device still won't join the network.
Has anyone else made the captive portal work on iOS devices?
I'm going to keep trying to make it work, but any pointers or advice would be appreciated.
Cheers,
Ben
const char *whitelisturl[nWHITELISTURLS] = {
"www.setup.com",
"www.unit.com",
"www.letmein.com",
"www.whateverelse.com",
"esp.nonet"
};
allowRedirect = FALSE;
for (j=0; j<nWHITELISTURLS; j++) {
if (strcmp(buff, whitelisturl[j]) == 0) {
allowRedirect = TRUE;
httpd_printf("Allowing Redirect for %s\n", buff);
break;
}
}
if (allowRedirect==FALSE) return;
httpd_printf("DNS: Q (type 0x%X class 0x%X) for %s\n", my_ntohs(&qf->type), my_ntohs(&qf->class), buff);