Welcome! Log In Create A New Profile

Advanced

Developing filter module: understanding chains

Posted by edo888 
Developing filter module: understanding chains
December 29, 2011 07:19PM
Hi,

I'm developing a filter module which should get a response from upstream server, modify it with an external program and send it to the client. I'm using nginx as a reverse proxy. I need to know how can I get the buffer chain flattened to be sent to an external program and then devide the result into chunks to be sent to the client.

I cannot find a documentation for the nginx chains and don't fully understand how they work.

Here is an example pseudo code (presuming there are no chains and in is the whole upstream response body):

... ngx_http_xxx_body_filter(... r, ... in) {
// execute the external program on body
out = execute_program(in);

// pass the result to the next body filter
ngx_http_next_body_filter(r, out);
}



Edited 2 time(s). Last edit at 12/29/2011 07:21PM by edo888.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 179
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready