使用代理进行ASP / XML解析

时间:2014-02-07 18:01:10

标签: xml asp-classic proxy

我需要为下面的请求添加代理。如果有人知道添加此代码的最佳方法,请不要重做太多,请告诉我。感谢

    TheFeed = "http://www.google.com/newsfeed.xml"
    objXML = Server.CreateObject ("MSXML2.ServerXMLHTTP.3.0") 
    objXML.Async = False
    objXML.SetProperty ("ServerHTTPRequest", True)
    objXML.setRequestHeader ("User-Agent", "asp httprequest") 
    objXML.ResolveExternals = True
    objXML.ValidateOnParse = True
    objXML.Load(TheFeed)

1 个答案:

答案 0 :(得分:1)

TheFeed = "http://www.google.com/newsfeed.xml"
objXML = Server.CreateObject ("MSXML2.ServerXMLHTTP.3.0") 
objXML.Async = False
objXML.SetProperty ("ServerHTTPRequest", True)
objXML.setRequestHeader ("User-Agent", "asp httprequest") 
objXML.ResolveExternals = True
objXML.ValidateOnParse = True
objXML.setProxy 2, "http=myProxyServer:80", ""
objXML.Load(TheFeed)