Re: Infinite data stream from a non-HTTPD external process via HTTPD

2011-09-20 Thread Mark Montague

On September 20, 2011 5:13 , Henrik Strand  wrote:

I would like to send an infinite data stream from a non-HTTPD external
process via HTTPD to the client connection. Both HTTP and HTTPS must be
supported.


Dw.'s solution is a good one, especially if the external process you are 
talking about is not a child process spawned by httpd.


In the special but very common case where the external process is a 
child process spawned by httpd, then the easiest solution is to have 
that process send its data to httpd (it's parent process) via STDOUT -- 
in other words, simply output the data as you normally would in any CGI 
script or other active content.


To explicitly answer other questions:

- Yes, httpd supports sending "infinite" amounts of data as long as 
output is sent at least as often as the value of the TimeOut directive 
(see https://httpd.apache.org/docs/2.2/mod/core.html#timeout ) and as 
long as the client (web browser, end user) does not close the connection 
by pressing the Stop button or by doing something else.


- Anything that works via HTTP should also work via HTTPS, as far as I 
know, including Dw's solution.


--
  Mark Montague
  m...@catseye.org



Re: Infinite data stream from a non-HTTPD external process via HTTPD

2011-09-20 Thread Dirk-Willem van Gulik

On 20 Sep 2011, at 10:41, Henrik Strand wrote:

> On Tue, 2011-09-20 at 11:32 +0200, Ben Noordhuis wrote:

>> On Tue, Sep 20, 2011 at 11:13, Henrik Strand  wrote:

>>> I would like to send an infinite data stream from a non-HTTPD external
>>> process via HTTPD to the client connection. Both HTTP and HTTPS must be
>>> supported.
>> 
>> What kind of external process are we talking here? Something that
>> prints to stdout, listens on a UNIX/TCP socket, something else?

> A process, running on the same system as httpd, that will generate a
> video stream (i.e., a stream of images and audio).

I found it very effective to use a socket pass (see Stevens[1] - or for the 
simplest case; see

http://httpd.apache.org/docs/2.3/mod/mod_proxy_fdpass.html

Or google on (WSADuplicateSocket, ioctl(I_SENDFD), sendmsg() with access 
rights, etc).  Unfortunately they are not quite as portable as one would want 
to.  Some old postings [2] may help, check the apr socket code. As you need to 
do a bit of work on the receiving side.

Let me know if you get totally stuck - I may have some old cruft - though that 
was more to then pass on to NPath - a proprietary load balancing technique to 
move the TCP connection to another server altogether while having the return 
path bypassing the LB hardware itself. 

Dw.

1: http://www.amazon.com/dp/0131411551/
2: http://archives.neohapsis.com/archives/postfix/2000-09/1476.html
http://lists.canonical.org/pipermail/kragen-hacks/2002-January/000292.html



Re: Infinite data stream from a non-HTTPD external process via HTTPD

2011-09-20 Thread Henrik Strand
A process, running on the same system as httpd, that will generate a
video stream (i.e., a stream of images and audio).

On Tue, 2011-09-20 at 11:32 +0200, Ben Noordhuis wrote:
> On Tue, Sep 20, 2011 at 11:13, Henrik Strand  wrote:
> > I would like to send an infinite data stream from a non-HTTPD external
> > process via HTTPD to the client connection. Both HTTP and HTTPS must be
> > supported.
> 
> What kind of external process are we talking here? Something that
> prints to stdout, listens on a UNIX/TCP socket, something else?




Re: Infinite data stream from a non-HTTPD external process via HTTPD

2011-09-20 Thread Ben Noordhuis
On Tue, Sep 20, 2011 at 11:13, Henrik Strand  wrote:
> I would like to send an infinite data stream from a non-HTTPD external
> process via HTTPD to the client connection. Both HTTP and HTTPS must be
> supported.

What kind of external process are we talking here? Something that
prints to stdout, listens on a UNIX/TCP socket, something else?


Infinite data stream from a non-HTTPD external process via HTTPD

2011-09-20 Thread Henrik Strand
Hi,

I would like to send an infinite data stream from a non-HTTPD external
process via HTTPD to the client connection. Both HTTP and HTTPS must be
supported.

Does HTTPD support this as of now? If not, how to implement such a
module?

Best Regards,
Henrik