From my Android TV box, I would like to get my public IP and other related info from ifconfig.co, but it does not seem to work. If I try this code, it works fine:
adb -s 192.168.1.125:5555 shell netcat icanhazip.com 80 <<< $'GET / HTTP/1.1\nHost: icanhazip.com\n\n'
... while this one returns an empty string:
adb -s 192.168.1.125:5555 shell netcat ifconfig.co 80 <<< $'GET / HTTP/1.1\nHost: ifconfig.co\n\n'
On the other hand, both sites work fine with curl (from another machine).
My objective is to retrieve the page ifconfig.co/json using netcat (the only available tool on the TV box) directly from shell (using a single line command). Any help would be much appreciated!