Hi,
The problem is that when using the tcp mode the Lua script dont log/print the host, path and only the ip is getting logged/printed. If i change the mode to http it prints/output everything, but i need it in tcp mode. Can someone help me to fix that?
This is how my HAProxy Configuration file look:
frontend RTMP
bind 0.0.0.0:1935
mode tcp
use_backend %[lua.choose_backend("d")]
backend a
balance roundrobin
mode tcp
server origin_1 192.168.1.19:1935 check fall 3 rise 2
backend b
balance roundrobin
mode tcp
server origin_1 192.168.1.20:1935 check fall 3 rise 2
And this is how my Lua script:
function my_hash(txn, salt)
local str = ""
str = "HOST: " .. txn.sf:req_fhdr("host")
str = str .. " PATH: "
str = str .. txn.sf:path()
str = str .. " SRC: "
str = str .. txn.sf:src()
core.log(core.info, str)
return 'a'
end
core.register_fetches("choose_backend", my_hash)