Jump to content
Sign in to follow this  

CheckProxyList UDF

Recommended Posts

This is a UDF version of the proxy checker that I posted a couple days ago. I eliminated the need for a temporary dump of all the proxies, and it no longer needs String.au3, and added the ability to update a progress bar as it gets done, and lowered the ping timeout to 450, so it only takes about 8 minutes to check a 1000 line list instead of 16 lol. and thanks to IchBistTod for the math for the progress bar and fixing the $aSplit array and other misc error checking :)

#include <IE.au3>
#include <ProgressConstants.au3>

; #FUNCTION# ====================================================================================================================
; Name...........: _CheckProxyList
; Description ...: Checks an online list of proxies
; Syntax.........: _CheckProxyList($sUrl[, $iTimeout = 450[, $iOffset = 1[, $sDelimeter = @CRLF[, $hProgress = 0]]])
; Parameters ....: $sUrl         - URL of the online proxy list
;                  $iOffset      - Line of the list to start at
;                  $sDelimeter   - Character to separate the valid proxies with
;                  $hProgress    - The handle of the progress bar you want to update
; Return values .: Success       - Returns the string with a list of the working proxies
;                  Failure       - Returns 0
; Author ........: zeffy
; Thanks ........; IchBistTod for math and error checking :)
; ===============================================================================================================================

Func _CheckProxyList($sUrl, $iTimeout = 450, $iOffset = 1, $sDelimeter = @CRLF, $hProgress = 0)

    $oIE = _IECreate($sUrl, 0, 0)
    If Not @error Then
        $sText = _IEBodyReadText($oIE)
        $aSplit = StringSplit(StringReplace($sText, @CR, ""), @LF)
        If $hProgress Then
            GUICtrlSetLimit($hProgress, 0, $aSplit[0])
        Local $sList
        For $iOffset To $aSplit[0]
            $sProxy = StringSplit($aSplit[$iOffset], ":")
            Ping($sProxy[1], $iTimeout)
            If Not @error Then
                $sList &= $aSplit[$iOffset] & $sDelimeter
            If $hProgress Then
                GUICtrlSetData($hProgress, Round((($iOffset / $aSplit[0]) * 100)))
        GUICtrlSetData($hProgress, 100)
        Return $sList
EndFunc   ;==>_CheckProxyList


#include "CheckProxyList.au3"
#include <WindowsConstants.au3>
#include <ProgressConstants.au3>

$Form1 = GUICreate("Form1", 275, 27, 192, 124)
$Progress1 = GUICtrlCreateProgress(1, 1, 273, 25)
$proxies = _CheckProxyList("http://www.textproxylists.com/proxy.php?allproxy", 450, 9, @CRLF, $Progress1)
FileWrite("proxylist.txt", $proxies)

Enjoy, and please post feedback :idea:



* added iTimeout option, to set custom ping timeout


Edited by Zef

Share this post

Link to post
Share on other sites

If ICMP protocol disabled on proxy server script show that proxy offline. I use HttpSetProxy+InetGet but it's not so fast as i want(

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...