How to route a request to a proxy server?

W

Water Cooler v2

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?
 
B

bruce barker

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)
 
W

Water Cooler v2

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.Redirect("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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top