Jump to content
Son zamanlarda artan kullanıcı hesap hırsızlıkları sebebiyle tüm kullanıcılara şifre sıfırlama maili gönderilmiştir. Lütfen güveli şifreler seçiniz. Mevcut e-mail adresinize erişemiyorsanız, en aşağıdaki destek linkinden bize ulaşınız. ×

Proxy Zamanına Göre Işlem Yapma?


Mehmet
 Share

Recommended Posts

Arkadaşlar Edit1'e eklediğim proxyleri sırası ile internete çıkış yaptırıyorum fakat Listede internete çıkışı olmayan veya geç çıkış yapan proxy'i nasıl atlayabilirim

Atıyorum 5 saniye içinde proxy cevap vermiyorsa yani internete çıkışı 5 saniye içinde gerçekleşmiyorsa diğer proxy'e atlasın istiyorum 

#include <Inet.au3>
#include <String.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 452, 282)
$Edit1 = GUICtrlCreateEdit("", 32, 32, 185, 241)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("Run", 320, 16, 75, 25)
$Edit2 = GUICtrlCreateEdit("", 232, 88, 169, 177)
GUICtrlSetData(-1, "")
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button1
            $aproxyread = StringSplit(GUICtrlRead($Edit1), @CR)
            For $aproxyadd = 1 To UBound($aproxyread) - 1
                HttpSetProxy(2, $aproxyread[$aproxyadd])
                GUICtrlSetData($Edit2, "Proxy: " & $aproxyread[$aproxyadd] & @CRLF & "IP: " & _IPGet())
            Next
    EndSwitch
WEnd

Func _IPGet()
    Local Const $GETIP_TIMER = 3000
    Local Static $hTimer = 0
    Local Static $sLastIP = 0
    If TimerDiff($hTimer) < $GETIP_TIMER And Not $sLastIP Then
        Return SetExtended(1, $sLastIP)
    EndIf
    Local $aGetIPURL[] = ["http://bot.whatismyipaddress.com", "http://www.myexternalip.com/raw", "http://checkip.dyndns.org"], $aReturn = 0, $sReturn = ""
    For $i = 1 To UBound($aGetIPURL) - 1
        $sReturn = InetRead($aGetIPURL[$i])
        If @error Or $sReturn == "" Then ContinueLoop
        $aReturn = StringRegExp(BinaryToString($sReturn), "((?:\d{1,3}\.){3}\d{1,3})", 3)
        If Not @error Then
            $sReturn = $aReturn[0]
            ExitLoop
        EndIf
        $sReturn = ""
    Next
    $hTimer = TimerInit()
    $sLastIP = $sReturn
    If $sReturn == "" Then Return SetError(1, 0, -1)
    Return $sReturn
EndFunc   ;==>_IPGet

 

Proxy list

193.194.69.36:3128
189.28.166.79:80
79.120.72.222:3128
203.66.159.44:3128
200.46.94.202:3128
198.50.129.9:3128
31.173.74.73:8080
178.33.191.53:3128
47.88.15.211:10080
38.83.105.194:8118
112.199.65.190:3128
47.88.15.211:10080
64.20.48.83:8080
149.202.249.227:3128

 

  • Like 1
Link to comment
Share on other sites

Please register to see this content.

Ping fonksiyonunu kullanabilirsin.

$zaman = Ping("193.194.69.36", 5000); 

dersin. Eğer $zaman 0 gelirse bu host'a 5 saniye içerisinde bağlanamıyorsun anlamına gelir. @error macrosundan spesifik hatayı bile bulabilirsin.

  • Like 1
Link to comment
Share on other sites

@MostWanted bu fonksiyon iyi gibi görünüyor teşekkür ederim, fakat 600 ms verdiğim halde bazen hata da veriyor bu normalmidir?

#include <MsgBoxConstants.au3>
Global $site = "autoitscript.com"
Example()

Func Example()

    Local $iPing = Ping($site, 600)

    If $iPing Then
        MsgBox($MB_SYSTEMMODAL, "", "Erişim zamanı: " & $iPing & "ms.")
    Else
        MsgBox($MB_SYSTEMMODAL, "", "Hata ve @error değeri: " & @error)
    EndIf
EndFunc

 

Link to comment
Share on other sites

7 dakika önce, sk8er_boi yazdı:

Proxy'nin bulunduğu ip'nin pinglenebiliyor olması, proxy'nin açık olduğu anlamına gelmez. 

@sk8er_boi Ozaman proxylerin çalışıp çalışmadığını Http durum kodları ile kontrol etmek dahamı mantıklı? mesela:200,500,404 gibi..

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...