Comparison

mod_websocket/mod_websocket.lua @ 1324:853a382c9bd6

mod_turncredentials: Advertise the XEP-0215 feature (thanks Gryffus)
author Kim Alvefur <zash@zash.se>
date Fri, 28 Feb 2014 15:36:06 +0100
parent 1272:717a08403b26
child 1325:b21236b6b8d8
comparison
equal deleted inserted replaced
1323:c84ff82658cb 1324:853a382c9bd6
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;
245 246
246 session.secure = consider_websocket_secure or session.secure; 247 session.secure = consider_websocket_secure or session.secure;
247 248
248 local frameBuffer = ""; 249 local frameBuffer = "";
249 add_filter(session, "bytes/in", function(data) 250 add_filter(session, "bytes/in", function(data)
283 route = { 284 route = {
284 ["GET"] = handle_request; 285 ["GET"] = handle_request;
285 ["GET /"] = handle_request; 286 ["GET /"] = handle_request;
286 }; 287 };
287 }); 288 });
288 end 289
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