how can I specify a proxy configuration using Microsoft.XMLHTTP?

前端 未结 4 1745
情深已故
情深已故 2020-12-03 12:04

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

I\'d like to be able to inspect what\'s going on with fiddler, and to do so I ha

4条回答
  •  盖世英雄少女心
    2020-12-03 12:59

    I looked at this thread to solve my issue - it helped but there are changes to newer systems now.
    My situation was making a web MSXML2.ServerXMLHTTP Call from a corporate server going through Proxy Server with digested Active Directory Credentials.

    There were a couple issues here for me, but I eventually managed to get it to work with just the Standard MSXML2.ServerXMLHTTP without having to specify the .3.0 or .6.0 versions.

    Newer windows servers do not have proxycfg, you need to use netsh as mentioned earlier.

    There are a few things you need lined up.
    In my scenario I was running the Website and Application Pool under the credentials of the AD User Account (This was required for database access) I would suggest that at least the Application Pool would need to run as the AD Account

    This was on a 64 Bit Windows System

    1. Obviously the AD User will need to have internet access
    2. You will need to specify the winhttp proxy settings using netsh
    3. If you have 'Enable 32 bit Applications' Enabled you will also need to set the winhttp proxy for 32 bit. It will look for that setting.

    So how?

    Check winhttp proxy settings At the Command Line

    %WINDIR%\System32\NETSH WINHTTP SHOW PROXY
    

    Check winhttp proxy settings At the Command Line

    %WINDIR%\SysWOW64\NETSH WINHTTP SHOW PROXY
    

    If you need to set them From the Command Line [change 8080 to your port]

    %WINDIR%\System32\NETSH WINHTTP SET PROXY PROXYSERVERURL:8080
    
    %WINDIR%\SysWOW64\NETSH WINHTTP SET PROXY PROXYSERVERURL:8080
    

提交回复
热议问题