2
-- print the socket information to all IP based routing
4
-- * setup one virtual IP per backend server
5
-- * let the proxy to all those IPs
6
-- * create a lua-table that maps a "client.dst.name" to a backend
11
function address_print(prefix, address)
12
print(("%s: %s (type = %d, address = %s, port = %d"):format(prefix,
13
address.name or "nil",
15
address.address or "nil",
16
address.port or -1)) -- unix-sockets don't have a port
20
-- print the address of the client side
22
function connect_server()
23
address_print("client src", proxy.connection.client.src)
24
address_print("client dst", proxy.connection.client.dst)
28
-- print the address of the connected side and trigger a close of the connection
30
function read_handshake()
31
address_print("server src", proxy.connection.server.src)
32
address_print("server dst", proxy.connection.server.dst)
34
-- tell the client the server denies us
36
type = proxy.MYSQLD_PACKET_ERR,
40
return proxy.PROXY_SEND_RESULT