Sign in to follow this  
Followers 0
Unc3nZureD

[UNSOLVED] Changing proxy in the middle of the script

12 posts in this topic

#1 ·  Posted (edited)

I've got the following script:
 

#include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #include <Array.au3>
     
    $Site = "http://whatismyipaddress.com/"
     
    $a = FileRead(@ScriptDir & "\Proxies.txt")
    $b = StringSplit($a, @CR & @LF & @CRLF)
    $b = ClearArray($b)
     
    Global $oIE[UBound($b)]
    GUICreate("Test Browser", 1000, 500, 0, 0)
    GUISetState(@SW_SHOW)
     
    $Bound = UBound($b) - 1
    For $i = 0 To $Bound
            If $i > 0  Then GUICtrlDelete($oIE[$i - 1])
            HttpSetProxy(2, $b[$i])
            $oIE[$i] = ObjCreate("Shell.Explorer.2")
            GUICtrlCreateObj($oIE[$i], 0, 0, 1000, 500)
            $oIE[$i].navigate($Site)
            ToolTip($i & "/" & $Bound & @CRLF & $b[$i], 0, 0)
            Sleep(5000)
    Next
     
    Func ClearArray($arr)
            $i = 0
            While 1
                    If $i > UBound($arr) - 1 Then ExitLoop
     
                    Local $Delete = 0
                    If $arr[$i] = " " Then
                            $Delete = 1
                    EndIf
                    If $arr[$i] = "" Then
                            $Delete = 1
                    EndIf
                    If $arr[$i] = @CR Then
                            $Delete = 1
                    EndIf
                    If $arr[$i] = @LF Then
                            $Delete = 1
                    EndIf
                    If $arr[$i] = @CRLF Then
                            $Delete = 1
                    EndIf
                    If StringLen($arr[$i]) < 9 Then
                            $Delete = 1
                    EndIf
                    If Not StringInStr($arr[$i], ":") Then
                            $Delete = 1
                    EndIf
                    If $Delete = 0 Then
                            $arr[$i] = StringReplace($arr[$i], " ", "")
                            $arr[$i] = StringReplace($arr[$i], @TAB, "")
                    EndIf
                    If $Delete = 1 Then
                            _ArrayDelete($arr, $i)
                            $i -= 1
                    EndIf
                    $i += 1
                    If $i = UBound($arr) Then ExitLoop
            WEnd
            Return $arr
    EndFunc

The problem is that my IP isn't changing. It should be different every time, but it isn't different... Did I miss something?

Edited by Unc3nZureD
1 person likes this

Share this post


Link to post
Share on other sites



If your code panel is not working (does not work for me in 8.1), just do it manually. See below

post-54985-0-05425900-1391549751_thumb.p


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

oh, simply [autoit.] and [/autoit.]? I didn't know :) Thanks, edited the code.

Edited by Unc3nZureD

Share this post


Link to post
Share on other sites

If you check Internet Explorer -> Internet Options -> Connections has the proxy changed?

If yes, did you try clearing cache and Temporary Internet Files? You might be seeing a cached page


s!mpL3 LAN Messenger

Current version 2.9.8.8 [30/09/2015]

Download Here

s!mpL3

Share this post


Link to post
Share on other sites

No, it didn't change. Isn't HttpSetProxy change the proxy settings only for the autoit processs?

Share this post


Link to post
Share on other sites

Tried to simplify everything, but the following one isn't working too:

$Site = "http://whatismyipaddress.com/"

GUICreate("Test Browser", 1000, 500, 0, 0)
GUISetState(@SW_SHOW)

HttpSetProxy(2, "109.123.115.157:3128")
$a = ObjCreate("Shell.Explorer.2")
$b = GUICtrlCreateObj($a, 0, 0, 1000, 500)
$a.navigate($Site)
Sleep(8000)

1 person likes this

Share this post


Link to post
Share on other sites

bump

Share this post


Link to post
Share on other sites

double bump :)

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Referring to my topic: >How can I use a different IP proxy before manipulating a web application

Will the HttpSetProxy() function sets the internet proxy to use for http access of my Internet Explorer only?

Or it will sets also the internet proxy of my other browser?

I can test it but I'm afraid if it also sets the other internet proxies..

Edited by Servant

Share this post


Link to post
Share on other sites

HttpSetProxy() just makes you Inet* commands use that proxy. It won't set any registry entries and whon't affect anything globally (If I'm right).

Share this post


Link to post
Share on other sites

HttpSetProxy() just makes you Inet* commands use that proxy. It won't set any registry entries and whon't affect anything globally (If I'm right).

Can you answer >my topic?    :think:

Share this post


Link to post
Share on other sites

Can you answer >my topic?    :think:

Please don't do this, it's impolite.


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

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  
Followers 0