How to route a request to a proxy server?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Water Cooler v2

    How to route a request to a proxy server?

    Normally, in ASP.NET applications, we read from a Request object and
    write to the Response buffer.

    However, I wish to read the request object, do some validations on it,
    and route the request to a proxy server. How is routing a request to a
    proxy server achieved in ASP.NET?
  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: How to route a request to a proxy server?

    you don't explain what you are trying to do. if you just need to see the
    first request, then redirect to the proxy.

    if you are trying to intercept all traffic to the proxy, then you are
    writing a proxy server. you will need to open a conteention to the proxy pass
    the data, and return the response. you will also need to map all content
    (*.jpg for example) to your app and pass thses on too (or parse the html and
    change urls). you will also need to handle remapping the cookies.

    -- bruce (sqlwork.com)


    "Water Cooler v2" wrote:
    Normally, in ASP.NET applications, we read from a Request object and
    write to the Response buffer.
    >
    However, I wish to read the request object, do some validations on it,
    and route the request to a proxy server. How is routing a request to a
    proxy server achieved in ASP.NET?
    >

    Comment

    • Water Cooler v2

      #3
      Re: How to route a request to a proxy server?

      Hi Bruce,

      Here's what I am trying to do.

      Let's say my app is called MyApp. MyApp has a WebForm called
      MyApp.aspx. This web form has a text box named txtInput.

      The user browses to MyApp.aspx and enteres the string "foo" into
      txtInput. He submits the page via a POST method.

      MyApp gets this request. It:

      a) authenticates the user;
      b) does some validation on the input entered by the user, ie. on the
      string "foo".
      c) if it wants to handle the request directly, it does so. In this
      case, handling the request directly always involves redirecting the
      user to some other page. So, in this case, MyApp simply says:

      Response.Redire ct("http://anotherURL.com/");

      d) if MyApp does NOT wish to directly redirect the user, but wants to
      send the request for redirection to some other reverse proxy, that
      will then perform the redirection, how does MyApp do that? That is my
      question.







      On Sep 15, 4:08 pm, bruce barker
      <brucebar...@di scussions.micro soft.comwrote:
      you don't explain what you are trying to do. if you just need to see the
      first request, then redirect to the proxy.
      >
      if you are trying to intercept all traffic to the proxy, then you are
      writing a proxy server. you will need to open a conteention to the proxy pass
      the data, and return the response. you will also need to map all content
      (*.jpg for example) to your app and pass thses on too (or parse the html and
      change urls). you will also need to handle remapping the cookies.
      >
      -- bruce (sqlwork.com)
      >
      "Water Cooler v2" wrote:
      Normally, in ASP.NET applications, we read from a Request object and
      write to the Response buffer.
      >
      However, I wish to read the request object, do some validations on it,
      and route the request to a proxy server. How is routing a request to a
      proxy server achieved in ASP.NET?

      Comment

      Working...