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

   

域名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"
posted @ 2017-03-21 18:09  jking10  阅读(17917)  评论(0编辑  收藏  举报