S
S
Space2015-10-01 03:09:07
PHP
Space, 2015-10-01 03:09:07

How to implement a proxy on the web?

Instagram login from one server is implemented and certain actions are performed. Instagram bans if more than 5 accounts come from one ip.
Everything is implemented in php. The question is whether it is possible to use a proxy somehow, i.e. For the script to do its work (requests) from another ip that I have access to?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
riot26, 2015-10-01
@ruslite

using curl:

$proxy = "127.0.0.1:8080";
$url = "https://toster.ru/q/253164";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0");
curl_setopt($ch, CURLOPT_PROXY, $proxy);
$page = curl_exec($ch);
curl_close($ch);

echo $page;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question