cURL, how to change the country of origin

2

I used cURL to log in automatically on Facebook, but a few minutes later I received a message that someone had accessed my United States account, and for security reasons they they asked if it was me ..

So, I believe that cURL uses the server to access the URL I set in curl_setopt , so the server should be located there ( USA ) ..

The question is, is there a way to fix this? I think it's something with HTTP headers, anyway, I'm grateful if you can open my mind to even tell me who knows a tutorial on how cURL works.

    
asked by anonymous 10.03.2015 / 23:39

1 answer

0

The only way to do this is to use PROXY , IP is the only thing that identifies the access location.

CURL has support for PROXY in several ways, you can use for example:

curl_setopt($ch, CURLOPT_PROXY, $proxy);

The $proxy must have the value of type:

[user:password@]ip[:port]

For example:

$proxy = 'usuario:[email protected]:8888'

Proxies can be purchased, their cost is extremely variable depending on the location, the quality of the connection and also the limit of use. You can get the server itself and use it as a proxy, using for example Squid Proxy , which is software designed for proxy creation. As another option is to use TOR , it can be used as a proxy and it is free, in this case the IP would be 127.0.0.1:9050 , if it is running on the local machine, and you should set exit node to destination you want in the settings.

This will do exactly:

Seu servidor (Nova Iorque) -> Seu proxy (São Paulo) -> Facebook

This way Facebook will recognize that the connection occurred in São Paulo, if São Paulo is near (or exactly) where you connect normally there will be no blocking. : D

    
03.02.2017 / 19:57