ts-lua
ts-lua copied to clipboard
Forward Proxy Mode Errors
Good Day Sir. i have enabled your code in my ATS Server running latest Fedora-20. well despite the hack i had to do in order to get it compiled (differences between Fedora-20 lua5.2 and compat-lua "5.1" needed for the plugin to compile) i need to mention that your code works only in reverse proxy mode and not in forward proxy mode.
when executed and included in the remap.config as such :
regex_map http://(.*).googlevideo.com/ http://$1.googlevideo.com/ @plugin=libtslua.so @pparam=/usr/local/etc/trafficserver/ts-lua-videoplayback.lua
i need to mention that it kept on restarting ATS with the following error in the diags:
[Apr 9 22:03:06.067] Server {0x40093a00} WARNING: Could not add rule at line #195; Aborting!
[Apr 9 22:03:06.067] Server {0x40093a00} WARNING: [ReverseProxy] Can't load plugin "/usr/local/libexec/trafficserver/libtslua.so" - /usr/local/libexec/trafficserver/libtslua.so: undefined symbol: lua_tointegerx at line 195
[Apr 9 22:03:06.067] Server {0x40093a00} WARNING: something failed during BuildTable() -- check your remap plugins!
[Apr 9 22:03:06.067] Server {0x40093a00} WARNING: Can not load the remap table, exiting out!
much regards
In fact, I never use forward proxy. I think it is no need to use plugin in forward proxy mode.
you would be surprised to the needs of Forward proxy mode in caching systems. it saves nearly 80% of the http bandwidth on ISPs (Internet Service Providers) which holds huge demand for it. unlike in reverse proxy mode which only saves bandwidth towards single domain/host .
hope you would reconsider getting it into forward proxy mode working the same as in reverse proxy mode.
Much regards
Agree - Forward proxy LUA would be extremely beneficial .
I think the error you get is caused by the libtslua.so depends on lua.so. which should able to be loaded using libloader.so in the plugin.config. I think you are using some version that not yet fix the lua into static linking. you should not need that in some later version or future versions.
and on the reverse vs forwarding proxy, you can always thinking that there is some very few diffirent in ATS, as there is just one change to require 'remap' or not in records.config. and you can always put the plugin into remap.config even in the forwarding mode, so it is simple as it should be.
and when you consider that we made some big fat lua script, would like to actived for any request in forwarding mode. you may use the regex_remap http://(.*)/ http://$1/ .... and global plugin is a good idea for this situation too, that is what we should consider in ts_lua.
hopes that will help
Thanks! Looks like this worked:
regex_map http://(.*) http://$1 @plugin=/usr/lib/trafficserver/modules/tslua.so @pparam=/etc/trafficserver/scripts/test_ret_403.lua
So I'm having a segfault. I can also notice that the lua session is not dying because a db connection I open from within remains open wasting the connection pool. here is a stack trace of the segfault http://pastebin.com/EV0m58d6
I found that the segfault come from TSDebug(...), Can you show me the lua script ?