我如何使用mod_perl2和Apache Bucket Brigades?

时间:2022-10-06 09:35:31

I'm writing an application to do proxying and rewriting of webpages on the fly and am pretty settled on using mod_perl2 - there is an existing implementation using mod_perl (v1) that I'm working from. In mod_perl2, there's this idea of APR::Brigades and APR::Buckets which, from my vague understanding, are an efficient way to do the sort of filtering & rewriting that I want. I can't, however, find anything but the Perldoc pages for these modules, so I'm really quite unsure how to utilize them.

我正在编写一个应用程序来动态地代理和重写网页,并且我已经完全决定使用mod_perl2 - 我正在使用的是mod_perl(v1)的现有实现。在mod_perl2中,有一个关于APR :: Brigades和APR :: Buckets的想法,根据我的模糊理解,这是一种有效的方法来进行我想要的过滤和重写。但是,我不能找到这些模块的Perldoc页面,所以我真的很不确定如何利用它们。

Can anyone explain mod_perl2 Bucket Brigades to me, point me to a tutorial, or even show me some open-source app that uses mod_perl2 that I could learn from?

任何人都可以向我解释mod_perl2 Bucket Brigades,给我一个教程,或者甚至向我展示一些使用mod_perl2的开源应用程序,我可以从中学到什么?

1 个解决方案

#1


Buckets and Brigades are native concept to the Apache Portable Runtime. You'll find ample examples of the native API, with a HTTP-specific slant, in the source code for Apache HTTP Server modules like mod_proxy, mod_deflate, and mod_substitute.

Buckets和Brigades是Apache Portable Runtime的原生概念。您可以在Apache HTTP Server模块的源代码(如mod_proxy,mod_deflate和mod_substitute)中找到本机API的大量示例,其中包含特定于HTTP的倾斜。

See the filter info here: http://www.apachetutor.org/dev/#filter

请在此处查看过滤器信息:http://www.apachetutor.org/dev/#filter

Then take a peek at the previously mentioned Apache HTTP Server modules.

然后看一下前面提到的Apache HTTP Server模块。

There seems to be a simple perl-specific filter here:

这里似乎有一个简单的perl特定过滤器:

http://perl.apache.org/docs/2.0/user/handlers/filters.html#Bucket_Brigade_based_Output_Filters

#1


Buckets and Brigades are native concept to the Apache Portable Runtime. You'll find ample examples of the native API, with a HTTP-specific slant, in the source code for Apache HTTP Server modules like mod_proxy, mod_deflate, and mod_substitute.

Buckets和Brigades是Apache Portable Runtime的原生概念。您可以在Apache HTTP Server模块的源代码(如mod_proxy,mod_deflate和mod_substitute)中找到本机API的大量示例,其中包含特定于HTTP的倾斜。

See the filter info here: http://www.apachetutor.org/dev/#filter

请在此处查看过滤器信息:http://www.apachetutor.org/dev/#filter

Then take a peek at the previously mentioned Apache HTTP Server modules.

然后看一下前面提到的Apache HTTP Server模块。

There seems to be a simple perl-specific filter here:

这里似乎有一个简单的perl特定过滤器:

http://perl.apache.org/docs/2.0/user/handlers/filters.html#Bucket_Brigade_based_Output_Filters