Diff

plugins/mod_websocket.lua @ 10616:37936c72846d 0.11

mod_websocket: Fire event on session creation (thanks Aaron van Meerten)
author Matthew Wild <mwild1@gmail.com>
date Fri, 24 Jan 2020 16:21:30 +0000
parent 10581:10d6d0d91f4e
child 10617:8941bebd64e4
child 11107:ddd0007e0f1b
line wrap: on
line diff
--- a/plugins/mod_websocket.lua	Thu Jan 23 21:59:13 2020 +0000
+++ b/plugins/mod_websocket.lua	Fri Jan 24 16:21:30 2020 +0000
@@ -305,6 +305,8 @@
 	response.headers.sec_webSocket_accept = base64(sha1(request.headers.sec_websocket_key .. "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"));
 	response.headers.sec_webSocket_protocol = "xmpp";
 
+	module:fire_event("websocket-session", { session = session, request = request });
+
 	session.log("debug", "Sending WebSocket handshake");
 
 	return "";