我怎么能使用Microsoft.XMLHTTP指定代理配置? [英] how can I specify a proxy configuration using Microsoft.XMLHTTP?

查看:1493
本文介绍了我怎么能使用Microsoft.XMLHTTP指定代理配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Microsoft.XMLHTTP从传统的ASP页面发布到其他网站信息...

I'm using Microsoft.XMLHTTP from a classic asp page to post info to another site...

我希望能够检查发生了什么事情与小提琴手,和这样做,我必须找到一个方法来配置Microsoft.XMLHTTP使用代理...

I'd like to be able to inspect what's going on with fiddler, and to do so I have to find a way to configure Microsoft.XMLHTTP to use a proxy...

这可能吗?在哪里呢Microsoft.XMLHTTP从获取它的配置?

is it possible? where does Microsoft.XMLHTTP gets its configuration from?

非常感谢

推荐答案

我觉得这里有些东西需要清理。

I think some things here need clearing up.

在同一类MSXML2.XMLHTTP的ProgIDMicrosoft.XMLHTTP之分。这个类使用Internet Explorer使用,因此将使用任何代理配置的PC上的互联网设置中发现的WinINET HTTP协议栈。

The ProgID "Microsoft.XMLHTTP" points at the same class as "MSXML2.XMLHTTP". This class uses the WinINET HTTP protocol stack that Internet Explorer uses and therefore will use whatever proxy configuration is found in the Internet Settings on the PC.

因此​​,对于Microsoft.XMLHTTP的proxycfg用法的命令是没有用的。

Hence for "Microsoft.XMLHTTP" the proxycfg command is not useful.

要XMLHTTP另一种是MSXML2.ServerXMLHTTP。这个类使用它被设计为轻量级和服务器友好的WinHTTP HTTP协议栈。它是安全的使用多个线程的多个实例中的相同的过程,其中的WinINET不是。出于这个原因,它是ServerXMLHTTP的应该在服务器端的ASP code使用。

An alternative to XMLHTTP is "MSXML2.ServerXMLHTTP". This class uses the WinHTTP HTTP protocol stack which is designed to be lightweight and server friendly. It is safe to use multiple instances in multiple threads in the same process where WinINET isn't. For this reason it is ServerXMLHTTP should be used in server-side ASP code.

WinHTTP不能使用的WinINET使用互联网设置,因此可以配置的ServerXMLHTTP将使用您需要使用proxycfg用法的命令代理。一个真正有用的命令是: -

WinHTTP does not use the Internet Settings that WinINET uses, hence to configure the proxy that ServerXMLHTTP will use you need to use the proxycfg command. A really useful command is:-

proxycfg -u

这会将当前的WinINET代理服务器设置为那些使用WinHTTP的,如果你使用的工具,如提琴手,这是非常有用的提琴手开始后,开始监控流量通过WinHTTP的打算。 (注意:您跟进 proxycfg用法-d 来删除代理设置)。

ServerXMLHTTP的也有一个 setProxy 方法,它允许实际的代理服务器设置动态配置是code。

ServerXMLHTTP also has a setProxy method which allows the actual proxy settings to be configured dynamically be code.

这篇关于我怎么能使用Microsoft.XMLHTTP指定代理配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆