Re: Proxy adding headers

2000-11-27 Thread Dave Rolsky

On Mon, 27 Nov 2000, Sander van Zoest wrote:

  Unfortunately, it seems that when I proxy I get the above added so I have
  to serve streaming audio directly from the mod_perl server, which is less
  than ideal in terms of resource use.

 If you mena you rewrite to mod_proxy, then mod_proxy does not fill
 headers{in} it simply ships what it gets from the remote server with the
 content and ships that. You would need to hack mod_proxy for it parse
 the headers and provide them to you in the normal request_rec structures.

 I have don't this before, but do not have rights to the code to post the
 patch, sorry. :-(

Actually, something is _adding_ headers and I want it to stop doing it.
It may not be mod_proxy, perhaps it is mod_rewrite.  I really don't know.


-dave

/*==
www.urth.org
We await the New Sun
==*/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Proxy adding headers

2000-11-27 Thread Sander van Zoest

On Mon, 27 Nov 2000, Dave Rolsky wrote:

 Actually, something is _adding_ headers and I want it to stop doing it.
 It may not be mod_proxy, perhaps it is mod_rewrite.  I really don't know.

Normally the mod_proxy code doesn't touch the headers, it simply sends
the headers on from the remote server you are proxying too. I doubt
it is mod_rewrite but it could be. The extra headers are probably coming
from your remote server you are proxying to.

--
Sander van Zoest [[EMAIL PROTECTED]]
Covalent Technologies, Inc.   http://www.covalent.net/
(415) 536-5218 http://www.vanzoest.com/sander/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Proxy adding headers

2000-11-27 Thread Dave Rolsky

On Mon, 27 Nov 2000, Sander van Zoest wrote:

 Normally the mod_proxy code doesn't touch the headers, it simply sends
 the headers on from the remote server you are proxying too. I doubt
 it is mod_rewrite but it could be. The extra headers are probably coming
 from your remote server you are proxying to.

I don't think so.  If I do a telnet to the proxy server (port 80, no
mod_perl) I get the extra headers.  If I telnet to the mod_perl enabled
server (port 12345), I get what I want (no extra headers).


-dave

/*==
www.urth.org
We await the New Sun
==*/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




[OT] Re: Proxy adding headers

2000-11-27 Thread Sander van Zoest

On Mon, 27 Nov 2000, Dave Rolsky wrote:

 On Mon, 27 Nov 2000, Sander van Zoest wrote:
  Normally the mod_proxy code doesn't touch the headers, it simply sends
  the headers on from the remote server you are proxying too. I doubt
  it is mod_rewrite but it could be. The extra headers are probably coming
  from your remote server you are proxying to.
 I don't think so.  If I do a telnet to the proxy server (port 80, no
 mod_perl) I get the extra headers.  If I telnet to the mod_perl enabled
 server (port 12345), I get what I want (no extra headers).

Ah, are you trying to send ICY headers or something? mod_proxy only knows
of HTTP and sends the appropriate status itself rather then what it
gets from the remote server. This will also require some hacks in 
mod_proxy to make it aware of the protocol you are trying to proxy.

Cheers,

--
Sander van Zoest [[EMAIL PROTECTED]]
Covalent Technologies, Inc.   http://www.covalent.net/
(415) 536-5218 http://www.vanzoest.com/sander/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [OT] Re: Proxy adding headers

2000-11-27 Thread Dave Rolsky

On Mon, 27 Nov 2000, Sander van Zoest wrote:

 Ah, are you trying to send ICY headers or something? mod_proxy only knows
 of HTTP and sends the appropriate status itself rather then what it
 gets from the remote server. This will also require some hacks in
 mod_proxy to make it aware of the protocol you are trying to proxy.

That is the exact problem.  Ok, the chances of me hacking mod_proxy are
next to nil.  At least now I know what I can't do to fix the problem
though ;)


-dave

/*==
www.urth.org
We await the New Sun
==*/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Proxy adding headers

2000-11-27 Thread Joe Schaefer

Dave Rolsky [EMAIL PROTECTED] writes:

 On Mon, 27 Nov 2000, Sander van Zoest wrote:
 
  Normally the mod_proxy code doesn't touch the headers, it simply sends
  the headers on from the remote server you are proxying too. I doubt
  it is mod_rewrite but it could be. The extra headers are probably coming
  from your remote server you are proxying to.
 
 I don't think so.  If I do a telnet to the proxy server (port 80, no
 mod_perl) I get the extra headers.  If I telnet to the mod_perl enabled
 server (port 12345), I get what I want (no extra headers).
 

Technically mod_proxy doesn't generate headers (here I'm 
taking the simple case of a non-cacheing http request). 
After stripping the connection header, it simply passes 
the headers it got from the backend server right on along
to r-connection via ap_proxy_send_hdr_line (or
ap_proxy_send_headers for cached files IIRC).

Moreover if your backend server calls ap_send_http_header 
during its response, it *must* return a Server and Date field 
unless your request is assbackwards. See the src for 
ap_basic_http_header in src/main/http_protocol.c.

mod_proxy will upgrade assbackwards requests to HTTP/1.0 
before passing them along to the backend server, which may 
explain why the date field shows up in your telnet experiments. 
Why not post the full output of your telnet sessions so we 
can see what is really going on?


HTH.
-- 
Joe Schaefer


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Proxy adding headers

2000-11-27 Thread Dave Rolsky

On 27 Nov 2000, Joe Schaefer wrote:

 mod_proxy will upgrade assbackwards requests to HTTP/1.0
 before passing them along to the backend server, which may
 explain why the date field shows up in your telnet experiments.
 Why not post the full output of your telnet sessions so we
 can see what is really going on?

Actually, this totally explains the problem, as did Sander's previous
post.  I'm attempting to use Apache as a non-HTTP server (sending ICY
headers for streaming MP3 instead).  So yes, its an assbackwards request
and its upgrading it.  Which is annoying.  It would be nice if this were
configurable in mod_proxy.c.  Maybe I will have to look at the code.  But
I'm afraid of C.

-dave

/*==
www.urth.org
We await the New Sun
==*/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Proxy adding headers

2000-11-27 Thread Joe Schaefer

Dave Rolsky [EMAIL PROTECTED] writes:

 I'm afraid of C.

Don't be. (perl is C with cream and sugar added ;)  Grab
a copy of Kernighan and Ritchie's _The C Programming Language_
(it's authoritative, and all of 274 pages cover to cover).  
Then start monkeying around in src/modules/proxy/proxy_http.c 
and/or src/main/http.protocol.c and see what you can cook up.  
Tweaking and/or commenting out a few lines should do the trick.
Just be sure to back up your apache tree before you start tinkering.

Best.
-- 
Joe Schaefer

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [OT] Re: Proxy adding headers

2000-11-27 Thread Dave Rolsky

On Mon, 27 Nov 2000, Sander van Zoest wrote:

 Ah, are you trying to send ICY headers or something? mod_proxy only knows
 of HTTP and sends the appropriate status itself rather then what it
 gets from the remote server. This will also require some hacks in
 mod_proxy to make it aware of the protocol you are trying to proxy.

Well, I guess C is easier than I thought.  I got it working via a new
config directive for mod_proxy, ProxyAddHeaders.  By default its true and
this means that mod_proxy will add minimal headers for wack responses from
the proxy server (like HTTP 0.9 or ICY or whatever).  However, if you turn
it off it will _not_ add these headers.  There is a bug in the current
state of the code in that if the caching code is called, it will add a
Date header if none exists.  I'm currently working around this by turning
off caching.

I'm going to see if there is interest in the Apache core team in having
this submitted as a patch.  Is so, I'll work around the remaining bug.

In the meantime, if anybody on this list is interested I can send you my
current patch, which is against 1.3.12.  Its not many lines so porting it
to a different Apache version should be trivial.

-dave

/*==
www.urth.org
We await the New Sun
==*/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Proxy adding headers

2000-11-27 Thread Gunther Birznieks

Dave's company could also *pay* someone to do what he wants. It would 
probably take about a day of someone at Covalent (probably less) to whip 
something up to stop doing the headers (and they would probably be able to 
feed the change back into the mod_proxy part of the Apache CVS directly so 
others would benefit).

At 10:10 PM 11/27/2000 -0500, Joe Schaefer wrote:
Dave Rolsky [EMAIL PROTECTED] writes:

  I'm afraid of C.

Don't be. (perl is C with cream and sugar added ;)  Grab
a copy of Kernighan and Ritchie's _The C Programming Language_
(it's authoritative, and all of 274 pages cover to cover).
Then start monkeying around in src/modules/proxy/proxy_http.c
and/or src/main/http.protocol.c and see what you can cook up.
Tweaking and/or commenting out a few lines should do the trick.
Just be sure to back up your apache tree before you start tinkering.

Best.
--
Joe Schaefer

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

__
Gunther Birznieks ([EMAIL PROTECTED])
eXtropia - The Web Technology Company
http://www.extropia.com/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Proxy adding headers

2000-11-27 Thread Dave Rolsky

On Tue, 28 Nov 2000, Gunther Birznieks wrote:

 Dave's company could also *pay* someone to do what he wants. It would
 probably take about a day of someone at Covalent (probably less) to whip
 something up to stop doing the headers (and they would probably be able to
 feed the change back into the mod_proxy part of the Apache CVS directly so
 others would benefit).

Great, as soon as I can find a company willing to fund my work on a
personal MP3 server I'll be all set ;)

Actually, I already did most of the patch and I sent a message to the
new-httpd list to discuss the possibility of making this a part of a
future release.  Of course, if someone at Covalent wants to help that's
great too.  And for the record, it took a lot less than a day.  About
1.5-2 hours, I'd say.


-dave

/*==
www.urth.org
We await the New Sun
==*/



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Proxy adding headers

2000-11-26 Thread Dave Rolsky

This sort of a mod_perl question.  When I use mod_rewrite to proxy to my
mod_perl backend servers, it seems that even if I explicitly don't send
headers I still get something like:

HTTP/1.0 OK
Date: blah bah

in front of anything I said.  The issue here is that I wrote some MP3
serving code based on Lincoln Stein's Apache::MP3 module.  To send
streaming mp3 data to a client like Winamp or XMMS, I need to be able to
have absolute control over the headers that are generated.

Unfortunately, it seems that when I proxy I get the above added so I have
to serve streaming audio directly from the mod_perl server, which is less
than ideal in terms of resource use.

Any ideas?


-dave


/*==
www.urth.org
We await the New Sun
==*/


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]