locked
RSS feed through proxy server fails RRS feed

  • Question

  • User-2080664153 posted

    Hi,

    I have RSS/XML feed code written in C# that works fine when not going through my company proxy server (say at home) but fails to get feed when not using the proxy server. I need to be able to display the contents of an external XML/RSS feed in an ASP page in both situations (through proxy server or without it). Can anyone suggest what I need to do?

    Regards

    Abrahimi

    Wednesday, November 25, 2009 2:21 PM

Answers

  • User-1293249277 posted

    Have you tried setting the proxy property?

        //Create a WebRequest

        WebRequest rssReq =

        WebRequest.Create("http://www.asp.net/news/rss.ashx");

     

        //Create a Proxy

        WebProxy px = new WebProxy("http://www.asp.net/news/rss.ashx", true);

     

        //Assign the proxy to the WebRequest

        rssReq.Proxy = px;

     

        //Set the timeout in Seconds for the WebRequest

        rssReq.Timeout = 5000;


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 25, 2009 11:43 PM

All replies

  • User-1293249277 posted

    Have you tried setting the proxy property?

        //Create a WebRequest

        WebRequest rssReq =

        WebRequest.Create("http://www.asp.net/news/rss.ashx");

     

        //Create a Proxy

        WebProxy px = new WebProxy("http://www.asp.net/news/rss.ashx", true);

     

        //Assign the proxy to the WebRequest

        rssReq.Proxy = px;

     

        //Set the timeout in Seconds for the WebRequest

        rssReq.Timeout = 5000;


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 25, 2009 11:43 PM
  • User-2080664153 posted

    Thank you kavita that is what I needed.

    Abahrami

    Friday, November 27, 2009 9:31 PM