php - How to dynamically change IP in the program
某草草
某草草 2017-05-18 10:47:10
0
2
762

How to implement the function of dynamically changing IP in the program, the IP address can be purchased from a certain treasure

某草草
某草草

reply all(2)
伊谢尔伦

That is, proxy, it depends on your program to implement it, proxy

左手右手慢动作

If your program is a client to request others, you can use http proxy. For example, how to configure http proxy using curl:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://baidu.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC); //代理认证模式
curl_setopt($ch, CURLOPT_PROXY, "xxx.xxx.xxx.xxx"); //代理服务器地址
curl_setopt($ch, CURLOPT_PROXYPORT, 80); //代理服务器端口
//curl_setopt($ch, CURLOPT_PROXYUSERPWD, ":"); //http代理认证帐号,username:password的格式
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); //使用http代理模式
$file_contents = curl_exec($ch);
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template