Last active
February 10, 2019 15:04
-
-
Save tieutantan/16b7587b559479584336a8a3a9c24f3b to your computer and use it in GitHub Desktop.
Check proxy simple by PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ip = '77.37.130.187:38578'; | |
$url = 'https://api.ipify.org'; // https://api.ipify.org/?format=json | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_PROXY, $ip); | |
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); | |
curl_setopt($ch, CURLOPT_TIMEOUT, 2); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | |
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla Android UCBrowser Safari'); | |
$response = curl_exec($ch); | |
if(curl_errno($ch)) echo 'Curl error: ' . curl_error($ch); | |
else echo $response; | |
curl_close($ch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment