lua-resty-websocket
lua-resty-websocket copied to clipboard
"send_text" got no error meesage after browser closed
my lua code is just like this:
local file = io.popen("tail -f /var/log/ping.log") for line in file:lines() do local bytes, err = wb:send_text(line) ngx.log(ngx.INFO, "LINE SENDED:",line,":",bytes,":",err)
if not bytes then
ngx.log(ngx.ERR, "failed to send a text frame: ", err)
return ngx.exit(444)
end
end file:close()
after my browser(chrome/edge) closed,the "send_text" still return bytes and no error,which I hope a zero bytes and error msage like "the client connection is closed"
need help
Hi @rttw , you can try to capture the packets using tcpdump
to determine if the server is disconnected?