On Tue, May 8, 2012 at 10:38 AM, Wendal Chen <wend...@gmail.com> wrote:
> 由于项目需要,我做了一个fork, 实现了这个需求
> https://github.com/wendal/lua-resty-http
>
> 实现了proxy_pass及修正了一些bug, 用法(演示一个无缓冲的Http代理服务器):
>
> local http = require 'resty.http'
>
> local hc = http:new()
>
> local ok, code, headers, status, body = hc:proxy_pass {
> url = 'http://' .. ngx.var.http_host .. ngx.var.request_uri,
> fetch_size = 1024,
> max_body_size = 100*1024*1024,
> }
>
> if not ok and not ngx.headers_sent then
> ngx.exit(502)
> end
>
> --- fetch_size是每读取多少字节就往浏览器写数据,默认值是16k
> --- max_body_size 最多接收多少字节,默认是1024mb
>
这个东西看起来很有趣 :)
>
> 如果觉得OK话,可否合并到 https://github.com/liseen/lua-resty-http 呢?
>
这个需要 liseen 同学来看一下了 :)
Regards,
-agentzh