Happy to report that the following modified line in MyPage() fixed the issue:
// Catching page request "/gen_204" and other variants is necessary for Android 7.1 and above.
if ((strcmp(url,"/index")==0) || (strcmp(url,"/gen")==0))
Looks like my Telnet test was bad - the “connection fail” does not make sense given that a connection is in play…
Anyhow, case closed!
PS - if anyone knows what /gen_204 is about for the record, that would be appreciated.