Home  >  Article  >  Backend Development  >  怎么在程序里面自动换ip地址呢

怎么在程序里面自动换ip地址呢

WBOY
WBOYOriginal
2016-06-13 10:18:471046browse

如何在程序里面自动换ip地址呢
采集的时候,
请问如何在程序里面自动换ip地址呢?

------解决方案--------------------
更换自己的ip吗,通过curl可以伪造ip来由

PHP code
<?php $ch=curl_init();curl_setopt($ch,CURLOPT_URL,"http://www.aaa.com/");curl_setopt($ch,CURLOPT_HTTPHEADER,array('X-FORWARDED-FOR:8.8.8.8','CLIENT-IP:8.8.8.8'));//构造IPcurl_setopt($ch,CURLOPT_REFERER, "http://www.xxxx.com/");//构造来由curl_setopt($ch,CURLOPT_HEADER, 1);$out = curl_exec($ch);curl_close($ch);<div class="clear">
                 
              
              
        
            
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn