@Abdullah thanks for you reply and suggestions.
My /etc/tor/torrc is well configured with port 9150 as SOCKS v5 proxy port. No confusion here.
In any case the error you show on your test exemplifying output for a wrong proxy port number:
curl: (7) Failed to connect to localhost port 9050 after 2250 ms: Couldn't connect to server
is different from MY reported error:
curl: (97) Can’t complete SOCKS5 connection to [ipinfo.io](http://ipinfo.io). (6)
I think the code is not faulty. In addition the problem is intermittent and seems to point to the ipinfo.io server not … serving (?!?)
At one point I mayget:
> jq -r '.' < <(/usr/bin/curl -s --socks5-hostname localhost:9150 -u <my_token>: ipinfo.io/json)
{
"ip": "94.230.208.xxx",
"hostname": "tor3e1.digitale-gesellschaft.ch",
"city": "Uster",
"region": "Zurich",
"country": "CH",
"loc": "47.3471,8.7209",
"org": "AS29691 Nine Internet Solutions AG",
"postal": "8610",
"timezone": "Europe/Zurich"
}
which is the correct response. Then at a later time, I may get:
> jq -r '.' < <(/usr/bin/curl -s --socks5-hostname localhost:9150 -u <my_token>: ipinfo.io/json)
parse error: Invalid numeric literal at line 3, column 0
So looking into the curl output I see that my query is denied.
> curl -s --socks5-hostname localhost:9150 -u <my_token>: ipinfo.io/json <html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>403 Forbidden</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Forbidden</h1>
<h2>Your client does not have permission to get URL <code>/</code> from this server.</h2> <h2></h2>
</body></html>
I don’t know whether it’s ipinfo.io that denies my query with “Your client does not have permission to get URL from this server.” or it’s the queried Tor node defending against the practice of Tor node mapping by some Internet actors.
Any further suggestion to troubleshoot this, anyone ?