trafficserver-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shu Kit Chan <>
Subject Re: Req. Info - ts_lua
Date Sat, 06 Dec 2014 00:16:15 GMT
Here is a small example of using ts_lua as a global plugin. please make
sure you a line of " /home/kichan/main.lua" in plugin.config and
the content of main.lua is as below.


local redis = require 'redis'
local client = redis.connect('', 6379)

function do_global_send_response()
  local response = client:ping()
  local value = client:get('mykey')
  ts.client_response.header['X-Redis-Ping'] = tostring(response)
  ts.client_response.header['X-Redis-MyKey'] = value

Please note
1) I have a local redis and I set a "mykey" already beforehand
2) I downloaded and compiled luasocket and redis-lua and put all "so" into
/home/kichan/lib/ and all lua files from them into /home/kichan/lualib/



On Fri, Dec 5, 2014 at 12:47 PM, Luca Rea <> wrote:

> Hi,
> can you share with us some lines of code / examples?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message