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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
$c = curl_init('http://192.0.43.10/u/r/l');
curl_setopt($c, CURLOPT_HTTPHEADER, array('Host: example.net'));
curl_exec($c);
回答2:
Try the snoopy library is much easier.