Hello everybody,

I'm currently thinking about a way how to intercept the binary data that
HttpWebRequest sends over the network. The class is a VERY helpful thing but
there are a few things that I obviously can't do with it. In particular I'd
like to have control over the header
REMOTE_ADDR. I have server application that uses REMOTE_ADDR and other
headers for identifying clients beyond cookies (which can easily be forged
or stolen). For load tests I'd have to send requests from PCs with
"different" internal IP addresses. As far as I know the REMOTE_ADDR is only
for information purposes and is not involved in any low-level network
routing and addressing.

Anybody has an idea?

Thanks, Christoph

Re: How to intercept what HttpWebRequest sends? by Jonathan

Jonathan
Tue Sep 28 18:00:08 CDT 2004

I think a IHttpModule will work for you. I don't know off hand how to use
it, but I believe it can be used for intercepting both the incoming and
outgoing data streams.

--
Jonathan Allen


"Christoph Wienands" <cwienands@gmx.de> wrote in message
news:OlpopvQpEHA.3488@TK2MSFTNGP12.phx.gbl...
> Hello everybody,
>
> I'm currently thinking about a way how to intercept the binary data that
> HttpWebRequest sends over the network. The class is a VERY helpful thing
but
> there are a few things that I obviously can't do with it. In particular
I'd
> like to have control over the header
> REMOTE_ADDR. I have server application that uses REMOTE_ADDR and other
> headers for identifying clients beyond cookies (which can easily be forged
> or stolen). For load tests I'd have to send requests from PCs with
> "different" internal IP addresses. As far as I know the REMOTE_ADDR is
only
> for information purposes and is not involved in any low-level network
> routing and addressing.
>
> Anybody has an idea?
>
> Thanks, Christoph
>
>



Re: How to intercept what HttpWebRequest sends? by Christoph

Christoph
Wed Sep 29 00:40:16 CDT 2004

Hi Jonathan,

> I think a IHttpModule will work for you. I don't know off hand how to use
> it, but I believe it can be used for intercepting both the incoming and
> outgoing data streams.

thanks a lot. I'll look into that...

Christoph



Re: How to intercept what HttpWebRequest sends? by Christoph

Christoph
Wed Sep 29 07:14:36 CDT 2004

Hi Jonathan,

"Jonathan Allen" <x@x.x> wrote in message
news:OpMIvDbpEHA.3500@TK2MSFTNGP15.phx.gbl...
> I think a IHttpModule will work for you. I don't know off hand how to use
> it, but I believe it can be used for intercepting both the incoming and
> outgoing data streams.

Unfortunately that was not what I was looking for. IHttpModule is only for
ASP.Net applications, on the server side. I need a solution on the client
side and I'm using the HttpWebRequest in the System.Net namespace.

Does anybody else have an idea?

Thanks, Christoph



RE: How to intercept what HttpWebRequest sends? by Fredrik

Fredrik
Tue Oct 05 04:43:06 CDT 2004

Hi, Im nor really sure if this is what you are after, but if youre looking
for a way to set the "REFERER"-header (REMOTE_ADDR in web-apps) with code,
just set the "referer"-property of the HttpWebRequest-object:

Dim wr as Net.HttpWebRequest = Net.HttpWebRequest.Create(URI)
wr.Referer = "MY_NEW_REFERER"

/Fredrik


"Christoph Wienands" wrote:

> Hello everybody,
>
> I'm currently thinking about a way how to intercept the binary data that
> HttpWebRequest sends over the network. The class is a VERY helpful thing but
> there are a few things that I obviously can't do with it. In particular I'd
> like to have control over the header
> REMOTE_ADDR. I have server application that uses REMOTE_ADDR and other
> headers for identifying clients beyond cookies (which can easily be forged
> or stolen). For load tests I'd have to send requests from PCs with
> "different" internal IP addresses. As far as I know the REMOTE_ADDR is only
> for information purposes and is not involved in any low-level network
> routing and addressing.
>
> Anybody has an idea?
>
> Thanks, Christoph
>
>
>

Re: How to intercept what HttpWebRequest sends? by Feroze

Feroze
Wed Oct 06 20:37:35 CDT 2004

If I understand the original question correctly, he is asking for a way to
control the IP address of the outgoing connection ( as on the webserver, the
REMOTE_ADDR server variable will be equal to the ip of the client).

If what I udnerstand is correct, unfortunately you cant do this currently.
Httpwebrequest does not give you control over the outgoing ip address to
use.

Have you thought about using authentication and/or SSL with client
certificates to make sure that clients are authenticated ?

--
feroze

-----------------
This posting is provided as-is. It offers no warranties and assigns no
rights.

See http://weblogs.asp.net/feroze_daud for System.Net related posts.
----------------

"Fredrik" <Fredrik@discussions.microsoft.com> wrote in message
news:3609BDE4-048A-49B2-B914-C708CE5096CC@microsoft.com...
> Hi, Im nor really sure if this is what you are after, but if youre looking
> for a way to set the "REFERER"-header (REMOTE_ADDR in web-apps) with code,
> just set the "referer"-property of the HttpWebRequest-object:
>
> Dim wr as Net.HttpWebRequest = Net.HttpWebRequest.Create(URI)
> wr.Referer = "MY_NEW_REFERER"
>
> /Fredrik
>
>
> "Christoph Wienands" wrote:
>
> > Hello everybody,
> >
> > I'm currently thinking about a way how to intercept the binary data that
> > HttpWebRequest sends over the network. The class is a VERY helpful thing
but
> > there are a few things that I obviously can't do with it. In particular
I'd
> > like to have control over the header
> > REMOTE_ADDR. I have server application that uses REMOTE_ADDR and other
> > headers for identifying clients beyond cookies (which can easily be
forged
> > or stolen). For load tests I'd have to send requests from PCs with
> > "different" internal IP addresses. As far as I know the REMOTE_ADDR is
only
> > for information purposes and is not involved in any low-level network
> > routing and addressing.
> >
> > Anybody has an idea?
> >
> > Thanks, Christoph
> >
> >
> >