Curl in php and IP address

后端 未结 2 1001
青春惊慌失措
青春惊慌失措 2020-12-12 02:48

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 whi

相关标签:
2条回答
  • 2020-12-12 02:58

    Try the snoopy library is much easier.

    0 讨论(0)
  • 2020-12-12 03:22
    $c = curl_init('http://192.0.43.10/u/r/l');
    curl_setopt($c, CURLOPT_HTTPHEADER, array('Host: example.net'));
    curl_exec($c);
    
    0 讨论(0)
提交回复
热议问题