curl请求指定host ip(指定域名解析的内网某ip)

时间:2017-03-21 18:26:45   收藏:0   阅读:2184

   

域名www.test.com解析内部多台ip
$httpHeader = array(‘Host: www.test.com‘);
$url = "10.17.2.245/xxx/xxx/t.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeader);

curl_setopt($ch, CURLOPT_URL, $url);

SHELL:

curl --silent -H "Host: www.test.com" "192.168.0.1/xxx/xxx/t.php"

原文:http://www.cnblogs.com/jking10/p/6595949.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!