Re: Using mod_lua to modify request body before being sent to mod_proxy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 15, 2016 at 9:10 PM, Matt Hughes <hughes.matt@xxxxxxxxx> wrote:
> I currently have Apache setup as a reverse proxy to another server.
>
> I was hoping to use mod_lua to slightly tweak the request body of incoming
> requests before sending them off to the other server. I have mod_lua setup
> enough so that I have a LuaHookInsertFilter that is pointing to my
> LuaInputFilter. But the question is, what does the function in the
> LuaHookInsertFilter have to return so that the modified request continues on
> to the proxy?
>
> Right now I have something like:
>
> function handle(r)
>     r.info(r, "example handler called") -- debug print
>     r:add_input_filter("myInputFilter")
>     return apache2.PROXYREQ_REVERSE
> end
>
> Am I using the right LuaHook? Any examples would be greatly appreciated.

Looks right to me. The underlying hook for "insert_filter" expects a
void return.

This means everyone who is registered gets called every time.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux