Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
function connect_server()
for i = 1, #proxy.global.backends do
local s = proxy.global.backends[i]
if s.state ~= proxy.BACKEND_STATE_DOWN then
proxy.connection.backend_ndx = i
-- print ("connecting to " .. i)
return
end
end
end
function read_query(packet)
for i = 1, #proxy.global.backends do
local s = proxy.global.backends[i]
if s.state ~= proxy.BACKEND_STATE_DOWN then
proxy.connection.backend_ndx = i
-- print ("connecting to " .. i)
return
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment