Software /
code /
prosody-modules
Comparison
mod_websocket/mod_websocket.lua @ 1325:b21236b6b8d8
Backed out changeset 853a382c9bd6
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 28 Feb 2014 15:37:55 +0100 |
parent | 1324:853a382c9bd6 |
child | 1340:3ffd64b4ab59 |
comparison
equal
deleted
inserted
replaced
1324:853a382c9bd6 | 1325:b21236b6b8d8 |
---|---|
240 | 240 |
241 conn:setlistener(c2s_listener); | 241 conn:setlistener(c2s_listener); |
242 c2s_listener.onconnect(conn); | 242 c2s_listener.onconnect(conn); |
243 | 243 |
244 local session = sessions[conn]; | 244 local session = sessions[conn]; |
245 session._http_request_headers = request.headers; | |
246 | 245 |
247 session.secure = consider_websocket_secure or session.secure; | 246 session.secure = consider_websocket_secure or session.secure; |
248 | 247 |
249 local frameBuffer = ""; | 248 local frameBuffer = ""; |
250 add_filter(session, "bytes/in", function(data) | 249 add_filter(session, "bytes/in", function(data) |
284 route = { | 283 route = { |
285 ["GET"] = handle_request; | 284 ["GET"] = handle_request; |
286 ["GET /"] = handle_request; | 285 ["GET /"] = handle_request; |
287 }; | 286 }; |
288 }); | 287 }); |
289 | 288 end |
290 module:add_item("alt-conn-method", { | |
291 rel = "urn:xmpp:altconnect:websocket"; | |
292 href = module:http_url(nil, "xmpp-websocket"):gsub("^http", "ws"); | |
293 }); | |
294 end | |
295 | |
296 |