0

I am trying to access ebay api to get information. I have three different ebay developer accounts but ebay suspends the accounts on accessing the accounts via same ip.

So I want to access each api with specific ip. I have used these techniques, but curl request is not successful, curl_error() returns "Failed to connect to ip"

curl_setopt($connection, CURLOPT_PROXY, $api_ids['ip']);
error : "failed to connect to ip"

and

curl_setopt($connection, CURLOPT_INTERFACE, $api_ids['ip']);
error : "bind failed with errno 99: Cannot assign requested address"

Moreover, I have easyhide vpn package, can I use Easyhide vpn ips in curl requests

curl request code:

curl_setopt($connection, CURLOPT_URL, $serverUrl);
//curl_setopt($connection, CURLOPT_PROXY, $api_ids['ip']);
//curl_setopt($connection, CURLOPT_PROXYUSERPWD, $api_ids['auth']);
curl_setopt($connection, CURLOPT_INTERFACE, $api_ids['ip']);
curl_setopt($connection, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($connection, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($connection, CURLOPT_HTTPHEADER, $headers);
curl_setopt($connection, CURLOPT_POST, 1);
curl_setopt($connection, CURLOPT_POSTFIELDS, $requestXmlBody);
curl_setopt($connection, CURLOPT_RETURNTRANSFER, 1);

Any kind of help will be appreciated, thanks

Hassan-Zahid
  • 417
  • 1
  • 7
  • 21
  • Possible duplicate of [select outgoing ip for curl request](http://stackoverflow.com/questions/2425651/select-outgoing-ip-for-curl-request) – Will Dec 30 '15 at 09:13
  • I have tried that, its included in the question – Hassan-Zahid Dec 30 '15 at 09:19
  • Well then there's just not enough information here. Does `ifconfig -a` show `$api_ids['ip']` that you're trying to bind to? How exactly is cURL failing? – Will Dec 30 '15 at 09:27
  • curl_error() says failed to connect to ip – Hassan-Zahid Dec 30 '15 at 09:38
  • And this works without the `CURLOPT_INTERFACE`? – Will Dec 30 '15 at 09:40
  • yes, it works without `CURLOPT_INTERFACE` and `CURLOPT_PROXY` – Hassan-Zahid Dec 30 '15 at 09:41
  • Well, don't use `CURLOPT_PROXY`, that's something different. Does it work with ONLY `CURLOPT_INTERFACE`? There is no SOCKS proxy listening on the IP you're using I'm assuming. You just need to bind to an interface. – Will Dec 30 '15 at 09:53
  • with only `CURLOPT_INTERFACE` it says "bind failed with errno 99: Cannot assign requested address" – Hassan-Zahid Dec 30 '15 at 10:08

0 Answers0