One method could be to check if a private IP network range is used and if traffic is from outside this private network. And then refuse connection if user name / password is not used. Like in a LAN with a DHCP-server and gateway.
That would cover, I suspect, 98% of the currently wide open calibre libraries.
|