Jump to content
Sign in to follow this  
elmoi0010

Proxy $oIE?

Recommended Posts

elmoi0010

Hello guys i just want to know a method to use proxys in _IE with autoit.. I tryed this:

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "http://www.cualesmiip.com/", False)
$oHttp.SetProxy(2,"61.58.82.26:8088")

$oHTTP.Send()
$oReceived = $oHTTP.ResponseText
$oStatusCode = $oHTTP.Status

If $oStatusCode == 200 then
 
EndIf

And it works, But i want to add that to _IE.. Is there a way ? i got various proxys and i want to use like a txt file to load proxys then load the webpage. Is there a way ? Am like new to autoit and i really want to learn, sorry mi bad english guys. Thanks in advanced.

EDIT: I tryed this code too, but its not working.

#include <IE.au3>
proxy()
_IECreate("cualesmiip.com")
Func proxy()
   HttpSetProxy(2, "111.205.122.222:80")
EndFunc
Edited by elmoi0010

Share this post


Link to post
Share on other sites
jguinch

Maybe directly from the registry :

#Include <IE.au3>

Local $sProxy = "proxyservername:80"

Local $oIE = _IECreate()

; Enable Proxy
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", 1)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ", $sProxy)
RefreshIE()

#cs
; Disable Proxy
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", 0)
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer")
RefreshIE()
#CE

_IENavigate($oIE, "http://google.com")




Func RefreshIE()
    DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)
    DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 37, 'str', 0, 'long', 0)
EndFunc
Edited by jguinch

Share this post


Link to post
Share on other sites
elmoi0010

 

Maybe directly from the registry :

#Include <IE.au3>

Local $sProxy = "proxyservername:80"

Local $oIE = _IECreate()

; Enable Proxy
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", 1)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ", $sProxy)
RefreshIE()

#cs
; Disable Proxy
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", 0)
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer")
RefreshIE()
#CE

_IENavigate($oIE, "http://google.com")




Func RefreshIE()
    DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)
    DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 37, 'str', 0, 'long', 0)
EndFunc

Thanks you so much bro, your code works i just did this. <3 

 

#Include <IE.au3>
Local $sProxy = "111.205.122.222:80"
Local $oIE = _IECreate()
Func Enable()
; Enable Proxy
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", 1)
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ", $sProxy)
RefreshIE()
EndFunc
Func Disable()
; Disable Proxy
RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", 0)
RegDelete("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer")
RefreshIE()
EndFunc
Enable()
_IENavigate($oIE, "cualesmiip.com")
_IELoadWait
Disable()
Func RefreshIE()
    DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0)
    DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 37, 'str', 0, 'long', 0)
EndFunc

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  

×