L
L
la02011-01-20 22:21:19
Computer networks
la0, 2011-01-20 22:21:19

Filtering HTTP traffic at the exit of the web server

Hello.

Is there a way to programmatically parse what the web server (eg Apache) returns and, for example, correct the returned content.
Cause. There is a script (a mixture of php and cgi) with a closed code, the output of which must be corrected, that is, by host, determine whether to interfere or not, and if you interfere, then apply an algorithm that does not fit into the regexp.

Preferably not too costly in terms of resources. Sometimes 5-10 requests per second to the script ...
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Krio, 2011-01-20
@Krio

If you are only interested in the content to be served, then try to configure the execution of all PHP scripts with the auto_prepend_file and auto_append_file settings . The 1st setting will indicate which file to run before starting the main script, and the 2nd setting after the main script is executed. You can also do this with .htaccess

php_value auto_prepend_file /var/www/public/_init_analiz.php
php_value auto_append_file /var/www/public/_end_analyz.php

L
la0, 2011-01-20
@la0

Thanks, but this is already known...
The content needs to be changed, and the problematic script makes it impossible to use ob_*...

R
relgames, 2011-01-23
@relgames

The solution "on the forehead" is to configure Apache on a different port, hang a self-written proxy on the old port that will contact Apache. Well, do data processing in a proxy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question