elmoi0010 Posted August 24, 2014 Share Posted August 24, 2014 (edited) 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 August 24, 2014 by elmoi0010 Link to comment Share on other sites More sharing options...
libreau3 Posted August 24, 2014 Share Posted August 24, 2014 If I understand the help document correctly this is what you are looking for https://www.autoitscript.com/autoit3/docs/functions/HttpSetProxy.htm . Just make sure to HttpSetProxy(1) at the end of your script to turn of the proxy. Link to comment Share on other sites More sharing options...
elmoi0010 Posted August 24, 2014 Author Share Posted August 24, 2014 If I understand the help document correctly this is what you are looking for https://www.autoitscript.com/autoit3/docs/functions/HttpSetProxy.htm . Just make sure to HttpSetProxy(1) at the end of your script to turn of the proxy. I tryed that, but it's not working too.. Link to comment Share on other sites More sharing options...
Solution jguinch Posted August 24, 2014 Solution Share Posted August 24, 2014 (edited) 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 August 24, 2014 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
elmoi0010 Posted August 24, 2014 Author Share Posted August 24, 2014 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now