0

I'd like to use a proxy to mask my ip surfing the net an autoit browser! This is my code:

#NoTrayIcon
#include <GUIConstants.au3>
#Include <IE.au3>
#include <GUIConstantsEx.au3>
GUICreate("Web Browser By EMP£!!",800,600)
GUISetBkColor(0x808080)
GUISetState(@SW_SHOW)
$Edit=GUICtrlCreateInput("http://www.whatismyip.com/",20,20,500,20)
$Vai=GUICtrlCreateButton("SURF!!!",600,10,150,50)
$oIE = ObjCreate("Shell.Explorer.2")
GUICtrlCreateObj($oIE, 10, 90,780, 500)
$ret = HttpSetProxy(2,"61.163.78.51:3128")
If $ret == 0 Then
    MsgBox(0, "Proxy", "Proxy Error")
    Exit
EndIf
While 1
 $msg=GUIGetMsg()
     Switch $msg
     Case $Vai
$Link=GUICtrlRead($Edit)
_IENavigate($oIE,($Link))
   GUICtrlSetData($Edit,$Link)
  Case $GUI_EVENT_CLOSE
   Exit
       EndSwitch
WEnd

I navigate on http://www.whatismyip.com/ and i can see my real ip address! I'd like to hide a proxy!

4

1 回答 1

1

HttpSetProxy功能仅适用于InetGet,对 Internet Explorer 设置没有影响。要为 Internet Explorer 窗口制作代理,您需要更改 Internet Explorer 设置。

我会这样做的方式是这样的:

#include <GUIConstants.au3>
#include <IE.au3>
#include <GUIConstantsEx.au3>

Global Const $sInetSettingsKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings"

GUICreate("Web Browser By EMP£!!", 800, 600)
GUISetBkColor(0x808080)
GUISetState(@SW_SHOW)
$Edit = GUICtrlCreateInput("http://www.whatismyip.com/", 20, 20, 500, 20)
$Vai = GUICtrlCreateButton("SURF!!!", 600, 10, 150, 50)
$oIE = ObjCreate("Shell.Explorer.2")
GUICtrlCreateObj($oIE, 10, 90, 780, 500)

MySetProxy("61.163.78.51:3128")

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $Vai
            $Link = GUICtrlRead($Edit)
            _IENavigate($oIE, ($Link))
            GUICtrlSetData($Edit, $Link)
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
WEnd

MySetProxy()

Func MySetProxy($sProxy = "", $fEnable = True)
    Local Static $sPrev = ""
    Local Static $fWasEnabled = False

    If $sProxy = "" Then
        If $sPrev <> "" Then __setProxyInfo($fWasEnabled, $sPrev)
    Else
        If $sPrev = "" Then
            $sPrev = RegRead($sInetSettingsKey, "ProxyServer")
            $fWasEnabled = RegRead($sInetSettingsKey, "ProxyEnable")
        EndIf

        __setProxyInfo($fEnable, $sProxy)
    EndIf
EndFunc

Func __setProxyInfo($fEnabled, $sProxy)
    RegWrite($sInetSettingsKey, "ProxyEnable", "REG_DWORD", 1)
    RegWrite($sInetSettingsKey, "ProxyServer", "REG_SZ", $sProxy)
EndFunc

whatismyip.com不过不太喜欢。但是IP地址肯定变了。

于 2012-07-01T15:53:43.813 回答