Re: Is this proxying possible

Re: Is this proxying possible

am 25.09.2003 15:03:32 von Daniel Lopez

On Thu, Sep 25, 2003 at 03:19:48PM +0200, Børge Nilsen wrote:
> I have a little problem that I though I could solve in a simple way using
> apache, but after going through the documentation I am not so sure...
>
> Basically the problem is that on my server I get some POST messages that I
> would like to do the following with:
> a: log the entire message to the file system
> b. add a field to the message itself (ideally within the http body)
> c. proxy the message to another server/ port for processing

> My first idea was that this could be done with a few rewrite rules and a
> perl script, but I'm beginning to get som doubts. Is there anyone out there
> that could help me...please...?
>
>

mod_rewrite does nto allow you to change the body,
If you are using Apache 2, you can write an input filter (if you are using
mod_perl, php or any other module that exposes the filtering API) or try and
use http://httpd.apache.org/docs-2.0/mod/mod_ext_filter.html
(works for output filtering, not sure it will work for input fitlering)

If you have Apache 1.3 and are using PHP or mod_perl or another solution,
you may be able to just acept the POST, issue teh request yourself using the
HTTP client libraries of PHP or Perl and then return the result to your users)

Cheers

DAniel


--
Teach Yourself Apache 2 -- http://apacheworld.org/ty24/

Is this proxying possible

am 25.09.2003 15:19:48 von borge.nilsen

I have a little problem that I though I could solve in a simple way using
apache, but after going through the documentation I am not so sure...

Basically the problem is that on my server I get some POST messages that I
would like to do the following with:
a: log the entire message to the file system
b. add a field to the message itself (ideally within the http body)
c. proxy the message to another server/ port for processing

My first idea was that this could be done with a few rewrite rules and a
perl script, but I'm beginning to get som doubts. Is there anyone out there
that could help me...please...?

RE: Is this proxying possible

am 25.09.2003 19:57:32 von Jorge.Reyes

T2sgSSBtYXkgaGF2ZSBzb21ldGhpbmcgdGhhdCB5b3UgY2FuIHVzZS4NClNv IHBvaW50IGJ5IHBv
aW50IGJlY2F1c2UgSSBkbyBub3QgdW5kZXJzdGFuZCBwb2ludCBCDQpJIGhh dmUgYSBwZXJsIHNj
cmlwdCB3aGljaCBJIHdyb3RlIHRoYXQgZG9lcyBhbGwgb2Ygd2hhdCB5b3Ug YXJlIGFza2luZy4N
ClRoZSB3YXkgdGhlIHNjcmlwdCB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