Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Test HTTP/Socks 4/Socks 5 Proxies
02-25-2010, 07:00 AM
Post: #1
Test HTTP/Socks 4/Socks 5 Proxies
This is interesting function that can be used on different purposes. Basically it uses cURL for checking if proxy is okay. It returns boolean value (true if proxy is okay).
Example of calling function :
Code:
checkproxy("189.24.10.208","3128","SOCKS 4");
Here is php code :
PHP Code:
<?php
function checkproxy($ip,$port,$type){
$ch curl_init("127.0.0.1");
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_HEADER0);
curl_setopt($chCURLOPT_CONNECTTIMEOUT10);
curl_setopt($chCURLOPT_TIMEOUT10);
curl_setopt($chCURLOPT_PROXY$ip ":" $port);
if(
$type == "SOCKS 4"curl_setopt($chCURLOPT_PROXYTYPECURLPROXY_SOCKS4);
else if(
$type == "SOCKS 5"curl_setopt($chCURLOPT_PROXYTYPECURLPROXY_SOCKS5);
$html curl_exec($ch);
$info curl_getinfo($ch);
if(
curl_errno($ch) || $html == "") {
return 
FALSE;
}else{
return 
TRUE;
}
curl_close($ch);


"I dont know with what weapons World War 3 will be fought with, but i know World War 4 will be fought with stones and sticks" - Albert Einstein
Visit this user's website Find all posts by this user
Quote this message in a reply
02-25-2010, 11:13 AM
Post: #2
RE: Test HTTP/Socks 4/Socks 5 Proxies
one of the pretty common used functions if you want to automize a bit your proxies, nice post! Smile

Read rules Smile
[Image: legislator.png]
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: