Skip to content

Instantly share code, notes, and snippets.

@griggheo
Created April 23, 2010 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save griggheo/376786 to your computer and use it in GitHub Desktop.
Save griggheo/376786 to your computer and use it in GitHub Desktop.
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