diff --git a/README.md b/README.md index 2d7212b..eea173a 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,7 @@ The script uses the following services for data retrieval: * [PeeringDB](https://www.peeringdb.com/) * [CAIDA ASRank](https://asrank.caida.org/) * [ifconfig.co](https://ifconfig.co/) +* [ipify](https://www.ipify.org/) * [RIPEStat](https://stat.ripe.net/) * [RIPE IPmap](https://ipmap.ripe.net/) * [ip-api](https://ip-api.com/) diff --git a/asn b/asn index 55c5b67..afd114c 100755 --- a/asn +++ b/asn @@ -2714,7 +2714,7 @@ AsnServerListener(){ # prepare the server URL (for the JS bookmarklet) if [ "$ASN_SRV_BINDADDR" = "0.0.0.0" ] || [ "$ASN_SRV_BINDADDR" = "::" ]; then - INTERNAL_ASNSERVER_ADDRESS="127.0.0.1:$ASN_SRV_BINDPORT" + INTERNAL_ASNSERVER_ADDRESS="$local_wanip:$ASN_SRV_BINDPORT" else INTERNAL_ASNSERVER_ADDRESS="$ASN_SRV_BINDADDR:$ASN_SRV_BINDPORT" fi @@ -2844,6 +2844,8 @@ WhatIsMyIP() { [[ -n "$local_wanip" ]] && return # retrieve local WAN IP (v6 takes precedence) from ifconfig.co local_wanip=$(docurl -s "https://ifconfig.co") + # handle ifconfig.co serving a captcha-type redirect page (e.g. when coming from some AWS networks) + grep -qE '^' <<<"$local_wanip" && local_wanip=$(docurl -s "https://api64.ipify.org") # check if we default to an IPv6 internet connection if echo "$local_wanip" | grep -q ':'; then HAVE_IPV6=true