Don't like ads? PRO users don't see any ads ;-)

Proxy Speedtest Beta

By: ShadowzKnowledge on Nov 4th, 2011  |  syntax: AutoIt  |  size: 1.86 KB  |  hits: 175  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <WinHTTP.au3>
  2. #include <File.au3>
  3.  
  4.  
  5. HotKeySet("{Esc}","_Exit")
  6.  
  7. $FILE_Path = FileOpenDialog("Plzzz select file xD",@ScriptDir,"(*.*)")
  8. If @error Then
  9.         Exit
  10. EndIf
  11. $Counter = InputBox("","Start at line ...",1)
  12. If @error Then
  13.         Exit
  14. endif
  15.  
  16. $LINES_Count_ProxyList = _FileCountLines($FILE_Path)
  17.  
  18. ProgressOn("Testing ...","")
  19. Do
  20.         ProgressSet($Counter/$LINES_Count_ProxyList*100,$Counter)
  21.         $Proxy = FileReadLine($FILE_Path, $Counter)
  22.         $Time = _Check_Proxy($Proxy)
  23.         FileWriteLine("test.txt",$Proxy&"|"&$Time)
  24.         $Counter += 1
  25. Until $Counter = $LINES_Count_ProxyList
  26.  
  27. MsgBox(0, "", "Done!")
  28.  
  29.  
  30.  
  31. Func _Check_Proxy($sProxy, $site = 'google.com')
  32.  
  33.         $hWinHttp = _winhttpOpen('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)')
  34.  
  35.         Local $tWINHTTP_PROXY_INFO[2] = [DllStructCreate("DWORD  dwAccessType;ptr lpszProxy;ptr lpszProxyBypass;"), DllStructCreate('wchar proxychars[' & StringLen($sProxy) + 1 & ']; wchar proxybypasschars[10]')]
  36.         DllStructSetData($tWINHTTP_PROXY_INFO[0], "dwAccessType", $WINHTTP_ACCESS_TYPE_NAMED_PROXY)
  37.         DllStructSetData($tWINHTTP_PROXY_INFO[0], "lpszProxy", DllStructGetPtr($tWINHTTP_PROXY_INFO[1], 'proxychars'))
  38.         DllStructSetData($tWINHTTP_PROXY_INFO[0], "lpszProxyBypass", DllStructGetPtr($tWINHTTP_PROXY_INFO[1], 'proxybypasschars'))
  39.         DllStructSetData($tWINHTTP_PROXY_INFO[1], "proxychars", $sProxy)
  40.         DllStructSetData($tWINHTTP_PROXY_INFO[1], "proxybypasschars", "localhost")
  41.         _WinHttpSetOption($hWinHttp, $WINHTTP_OPTION_PROXY, $tWINHTTP_PROXY_INFO[0])
  42.  
  43.  
  44.         $hTimer = TimerInit()
  45.         $hConnection = _WinHTTPConnect($hWinHttp, $site)
  46.         $sHTML = _winhttpSimpleRequest($hConnection, 'GET')
  47.         $Diff = TimerDiff($hTimer)
  48.  
  49.         _winhttpclosehandle($hConnection)
  50.         _winhttpclosehandle($hWinHttp)
  51.  
  52.         If $sHTML = "0" Then
  53.                 SetError(-1)
  54.                 Return -1
  55.         Else
  56.                 Return $Diff
  57.         EndIf
  58. EndFunc   ;==>_Check_Proxy
  59.  
  60.  
  61.  
  62. Func _Exit()
  63.         Exit
  64. EndFunc