Hello,
I'm trying to make HAProxy work as a router for certain requests. What I
have is a very simple configuration which sends every tcp request to a
Lua script. The script then is responsible to parse the request, see for
which server it is and forward it there. It then waits for a response
and forwards the response back to the requester.
The code is kind of the following:
function hello(txn)
local request_msg = txn.req:dup()
local tsm_sock = core.tcp()
tsm_sock:connect("127.0.0.1", 7777)
local res = tsm_sock:send(request_msg)
local response = tsm_sock:receive('*l')
txn.res:send(response)
txn:close()
end
The problem is that in versions 1.6-dev2 and 1.6-dev3, socket.connect timeouts.
The server to which we connect is a simple echo server. I've telneted numerous
times directly to it and experienced no problems, so I assume that the error ain't
there. Also, on version 1.6-dev1, the connect doesn't timeout and everything works
okay.
What could be the issue?
Thanks!
--
Tsvetan
I'm trying to make HAProxy work as a router for certain requests. What I
have is a very simple configuration which sends every tcp request to a
Lua script. The script then is responsible to parse the request, see for
which server it is and forward it there. It then waits for a response
and forwards the response back to the requester.
The code is kind of the following:
function hello(txn)
local request_msg = txn.req:dup()
local tsm_sock = core.tcp()
tsm_sock:connect("127.0.0.1", 7777)
local res = tsm_sock:send(request_msg)
local response = tsm_sock:receive('*l')
txn.res:send(response)
txn:close()
end
The problem is that in versions 1.6-dev2 and 1.6-dev3, socket.connect timeouts.
The server to which we connect is a simple echo server. I've telneted numerous
times directly to it and experienced no problems, so I assume that the error ain't
there. Also, on version 1.6-dev1, the connect doesn't timeout and everything works
okay.
What could be the issue?
Thanks!
--
Tsvetan