Problem: improve curl proxy method
radio24 opened this issue · 3 comments
radio24 commented
nyxnor commented
I haven't seen the exit code 97 yet neither on the man page https://curl.se/docs/manpage.html#exit-codes
$ curl -x socks5h://127.0.0.1:9050 -m 6 -s https://check.torproject.org/api/ip
{"IsTor":true,"IP":"22.333.444.555"}
$ echo $?
0
$ curl -x socks5h://127.0.0.1:9050 -m 6 -s http://google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>301 Moved</TITLE></HEAD><BODY>
<H1>301 Moved</H1>
The document has moved
<A HREF="http://www.google.com/">here</A>.
</BODY></HTML>
$ echo $?
0
nyxnor commented
First try was correct domain, second try is incorrect and shows 97
$ OCHECK=$(curl -x socks5h://127.0.0.1:9050 -m 6 -s http://google.com)
$ echo $?
0
$ OCHECK=$(curl -x socks5h://127.0.0.1:9050 -m 6 -s http://google.coa)
$ echo $?
97
radio24 commented
Ok, found the problem - it was the URL. Thanks for helping!