On 2015-11-06 15:12, Julien FROMENT wrote:
Hello,



We would like to use Apache HTTP Server to keep track of exactly what
part of the response was sent over a socket. Apache could call an API
asynchronously with the number of bytes sent over the socket for a given
request.



Here is the pseudo code:

   -- Client send a request

   -- Apache processes the request and send it to the backend server

   ...

   -- The backend server returns the response

   -- Apache sends the response to the client

   -- Apache calls Async API with the number of bytes sent


Relaying the client request to a backend server may be realised with the ProxyPass and RewriteRule directives.

Apache may log the number of bytes sent. See http://httpd.apache.org/docs/current/mod/mod_log_config.html#formats, the %B and %O flags.

The log can be configured to be

1. appended to a file
2. sent to syslog (which in turn may forward it over udp/tcp to a log-host)
3. piped to an external program

The first two options do not require any development from your part. If you really need that the number of bytes is sent to an http server, then you could write an external program that reads one line at a time from standard input and sends the line that it read to an http server.

Regards,
Sorin

Reply via email to