File

plugins/keepalive.lua @ 414:2a5eff919f4a

libs.hashes: Switch to moteus bgcrypto suite Because LuaCrypto seems to be unmaintained and bgcrypto has PBKDF2 https://luarocks.org/modules/moteus/bgcrypto-lmd5 https://luarocks.org/modules/moteus/bgcrypto-sha https://luarocks.org/modules/moteus/bgcrypto-hmac https://luarocks.org/modules/moteus/bgcrypto-pbkdf2
author Kim Alvefur <zash@zash.se>
date Sun, 20 May 2018 00:51:58 +0200
parent 250:a5ac643a7fd6
line wrap: on
line source

local verse = require "verse";

function verse.plugins.keepalive(stream)
	stream.keepalive_timeout = stream.keepalive_timeout or 300;
	verse.add_task(stream.keepalive_timeout, function ()
		stream.conn:write(" ");
		return stream.keepalive_timeout;
	end);
end