Software /
code /
prosody
Comparison
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 |
comparison
equal
deleted
inserted
replaced
10610:b9a054ad38e7 | 10616:37936c72846d |
---|---|
303 response.headers.upgrade = "websocket"; | 303 response.headers.upgrade = "websocket"; |
304 response.headers.connection = "Upgrade"; | 304 response.headers.connection = "Upgrade"; |
305 response.headers.sec_webSocket_accept = base64(sha1(request.headers.sec_websocket_key .. "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")); | 305 response.headers.sec_webSocket_accept = base64(sha1(request.headers.sec_websocket_key .. "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")); |
306 response.headers.sec_webSocket_protocol = "xmpp"; | 306 response.headers.sec_webSocket_protocol = "xmpp"; |
307 | 307 |
308 module:fire_event("websocket-session", { session = session, request = request }); | |
309 | |
308 session.log("debug", "Sending WebSocket handshake"); | 310 session.log("debug", "Sending WebSocket handshake"); |
309 | 311 |
310 return ""; | 312 return ""; |
311 end | 313 end |
312 | 314 |