vmware/nsx-alb-datascript-samples-library

"avi.l4.send(payload2)" can not work. attempt to call field 'send' (a nil value)

yamashin55 opened this issue · 0 comments

Describe the bug

The command "avi.l4.send(payload2)" does not work. The following error is output when the command is executed. And Reset is returned from ALB.

"attempt to call field 'send' (a nil value)"

Reproduction steps

1. Version v21.1.4
2. L4 Application VS. and L4 Response Event
3. Run the data script below.

-- L4 Response Event Script
function string.tohex(str)
    return (str:gsub('.', function (c)
        return string.format('%02X', string.byte(c))
    end))
end

buffered = avi.l4.collect(10)
payload = avi.l4.read()
if string.beginswith(payload , "354") then
   tag = "ClientIP: " ..  avi.vs.client_ip()
   hextag = string.tohex(tag)
   avi.l4.send(hextag)                   <<<----!!
   avi.l4.ds_done()
end
-----

...

Expected behavior

Payload data is correctly sent from ALB to server.

Additional context

Reference: https://avinetworks.com/docs/22.1/datascript-l4-ssl/