Comparison

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
comparison
equal deleted inserted replaced
10614:431511e190bc 10615:2bc918999615
290 response.headers.upgrade = "websocket"; 290 response.headers.upgrade = "websocket";
291 response.headers.connection = "Upgrade"; 291 response.headers.connection = "Upgrade";
292 response.headers.sec_webSocket_accept = base64(sha1(request.headers.sec_websocket_key .. "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")); 292 response.headers.sec_webSocket_accept = base64(sha1(request.headers.sec_websocket_key .. "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"));
293 response.headers.sec_webSocket_protocol = "xmpp"; 293 response.headers.sec_webSocket_protocol = "xmpp";
294 294
295 module:fire_event("websocket-session", { session = session, request = request });
296
295 session.log("debug", "Sending WebSocket handshake"); 297 session.log("debug", "Sending WebSocket handshake");
296 298
297 return ""; 299 return "";
298 end 300 end
299 301