1

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!

1 Answer 1

0

Replace the site ifconfig.co with ipinfo.io

2
  • yes, it worked! Thank you very much. Commented Feb 18, 2021 at 15:19
  • @user1202609: you have designated this as the "accepted" answer, which is a good thing. you should consider upvoting this answer. i.e. it is a "useful" answer, and it is also the "selected" answer. Commented Feb 19, 2021 at 1:21

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.