在VBA中使用Socks5代理

时间:2014-03-11 11:42:35

标签: vba proxy msxml socks

我想通过Sock5代理路由Excel VBA工具生成的所有网络流量。

我已在“控制面板”的“Internet设置”中添加了代理地址和端口号。

但是当我通过Wireshark分析我们正在交换的数据包时,我发现我的机器正在与目的地进行直接通信。

但是,当我分析使用chrome或TOR时发生的数据包时,交换似乎是通过Sock5代理服务器进行的。

Follwing是我用来连接的代码片段:

         xmlhttp.setProxy SXH_PROXY_SET_PRECONFIG
  xmlhttp.Open "GET", url, False

            xmlhttp.setrequestheader "Content-Type", "text/html"

           xmlhttp.setrequestheader "User-Agent", " Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0"

        xmlhttp.setrequestheader "Connection", " keep-alive"
        xmlhttp.setrequestheader "Cache-Control", "max-age=0"
        xmlhttp.setrequestheader "Accept-Language", "en-us,en;q=0.5"
        xmlhttp.setrequestheader "Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"

        xmlhttp.send

虽然我不确定我是否正确使用“SetProxy”。

请帮助..

0 个答案:

没有答案