Leonid
Leonid

Reputation: 55

Curl in php and IP address

I want to connect to the URL http://example.net using curl, but I need to connect with server with IP adress 192.0.43.10. How I can say to curl which IP adress it must use?

Upvotes: 2

Views: 5443

Answers (2)

phihag
phihag

Reputation: 287835

$c = curl_init('http://192.0.43.10/u/r/l');
curl_setopt($c, CURLOPT_HTTPHEADER, array('Host: example.net'));
curl_exec($c);

Upvotes: 3

yannisl
yannisl

Reputation: 704

Try the snoopy library is much easier.

Upvotes: 0

Related Questions