![]() onion domains via the normal DNS system, because this is a reserved top-level domain specifically for use by Tor and such domains by design have no IP addresses to map to. TL DR: Set CURLOPT_PROXYTYPE to use CURLPROXY_SOCKS5_HOSTNAME if you have a modern PHP, the value 7 otherwise, and/or correct the CURLOPT_PROXY value.Īs you correctly deduced, you cannot resolve. There is a very similar Stack Overflow question, cURL request using socks5 proxy fails when using PHP, but it works through the command line. I've searched for a way to tell cURL/PHP to let the proxy resolve the hostname, but I can't find a way. When running the PHP code above, my guess is that cURL or PHP is trying to resolve the. ![]() ![]() I believe the reason it works from the command line is because Tor (the proxy) is resolving the. Use the specified SOCKS5 proxy (and let the proxy resolve the host name). The PHP cURL documentation says this: -socks5-hostname However, when I run the following command from my command line in Ubuntu: curl -v -socks5-hostname localhost:9050 When I run it, I get the following error: I'm trying to connect to a Tor hidden service using the following PHP code: $url = ''Ĭurl_setopt($ch, CURLOPT_RETURNTRANSFER, true) Ĭurl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5) Comments on this question have been disabled, but it is still accepting new answers and other interactions.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |