Diff

plugins/mod_websocket.lua @ 10615:2bc918999615

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 10582:6d4562acef81
child 10617:8941bebd64e4
line wrap: on
line diff
--- a/plugins/mod_websocket.lua	Fri Jan 24 13:50:02 2020 +0000
+++ b/plugins/mod_websocket.lua	Fri Jan 24 16:21:30 2020 +0000
@@ -292,6 +292,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 "";