C
C
consumerdefault7892021-07-01 15:30:01
PHP
consumerdefault789, 2021-07-01 15:30:01

Curl does not work via ipv6, how to understand what is the problem?

$uCurl = curl_init('https://google.com');

        curl_setopt ($uCurl, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt ($uCurl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt ($uCurl, CURLOPT_TIMEOUT, 10);

        curl_setopt($uCurl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6);
        curl_setopt($uCurl, CURLOPT_INTERFACE, 'xxxx:xxx:xxxx:xxxx:0000:0000:0000:0001');
        curl_setopt($uCurl, CURLOPT_RETURNTRANSFER, true);

        $uResponse = curl_exec ($uCurl);
        curl_close ($uCurl);

        echo "\n";
        var_dump( $uResponse);
        echo "\n";

displays the google code, if I put the address https://api.binance.com/api/v3/exchangeInfo then the answer is bool(false) , what could be the problem? did a ping on ipv6 xxxx:xxx:xxxx:xxxx:0000:0000:0000:0001 packets are coming, the address on the VPS where the code is being executed, where to dig?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2021-07-02
@consumerdefault789

And who said that this site is accessible via ipv6?

$ dig -t AAAA api.binance.com
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
...
;; QUESTION SECTION:
;api.binance.com.               IN      AAAA

;; ANSWER SECTION:
api.binance.com.        92      IN      CNAME   d3h36i1mno13q3.cloudfront.net.

$ dig -t AAAA d3h36i1mno13q3.cloudfront.net.
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question