Answer the question
In order to leave comments, you need to log in
How to get data through proxy?
The problem is this.
I get data via API.
The data that comes in them has a picture (link to the Yandex disk to the picture itself).
Since I am from Ukraine, Yandex is banned.
When I did it on LAN, I turned on vpn and everything was downloaded. Now posted on a server in Europe.
And it does not work, it is impossible to pull out the picture. I can not understand why, if the site is in Europe.
I try through proxy, does not work.
How to solve the problem?
Connect vpn on server, proxy?
curl_setopt_array($curl, array(
CURLOPT_URL => $this->url,
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_PROXY => $this->proxy,
CURLOPT_PROXYUSERPWD => $this->userpwd,
CURLOPT_PROXYTYPE => CURLPROXY_SOCKS5,
CURLOPT_USERAGENT => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.93 Safari/537.36',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'X-API-KEY: '.$this->apiKey,
),
));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question