
Proxy Speedtest Beta
#include <WinHTTP.au3>
#include <File.au3>
HotKeySet("{Esc}","_Exit")
$FILE_Path = FileOpenDialog("Plzzz select file xD",@ScriptDir,"(*.*)")
If @error Then
Exit
EndIf
$Counter = InputBox("","Start at line ...",1)
If @error Then
Exit
endif
$LINES_Count_ProxyList = _FileCountLines($FILE_Path)
ProgressOn("Testing ...","")
Do
ProgressSet($Counter/$LINES_Count_ProxyList*100,$Counter)
$Proxy = FileReadLine($FILE_Path, $Counter)
$Time = _Check_Proxy($Proxy)
FileWriteLine("test.txt",$Proxy&"|"&$Time)
$Counter += 1
Until $Counter = $LINES_Count_ProxyList
MsgBox(0, "", "Done!")
Func _Check_Proxy($sProxy, $site = 'google.com')
$hWinHttp = _winhttpOpen('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)')
Local $tWINHTTP_PROXY_INFO[2] = [DllStructCreate("DWORD dwAccessType;ptr lpszProxy;ptr lpszProxyBypass;"), DllStructCreate('wchar proxychars[' & StringLen($sProxy) + 1 & ']; wchar proxybypasschars[10]')]
DllStructSetData($tWINHTTP_PROXY_INFO[0], "dwAccessType", $WINHTTP_ACCESS_TYPE_NAMED_PROXY)
DllStructSetData($tWINHTTP_PROXY_INFO[0], "lpszProxy", DllStructGetPtr($tWINHTTP_PROXY_INFO[1], 'proxychars'))
DllStructSetData($tWINHTTP_PROXY_INFO[0], "lpszProxyBypass", DllStructGetPtr($tWINHTTP_PROXY_INFO[1], 'proxybypasschars'))
DllStructSetData($tWINHTTP_PROXY_INFO[1], "proxychars", $sProxy)
DllStructSetData($tWINHTTP_PROXY_INFO[1], "proxybypasschars", "localhost")
_WinHttpSetOption($hWinHttp, $WINHTTP_OPTION_PROXY, $tWINHTTP_PROXY_INFO[0])
$hTimer = TimerInit()
$hConnection = _WinHTTPConnect($hWinHttp, $site)
$sHTML = _winhttpSimpleRequest($hConnection, 'GET')
$Diff = TimerDiff($hTimer)
_winhttpclosehandle($hConnection)
_winhttpclosehandle($hWinHttp)
If $sHTML = "0" Then
SetError(-1)
Return -1
Else
Return $Diff
EndIf
EndFunc ;==>_Check_Proxy
Func _Exit()
Exit
EndFunc