diff 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
parents 717a08403b26
children b21236b6b8d8
line wrap: on
line diff
--- a/mod_websocket/mod_websocket.lua	Wed Feb 26 13:08:47 2014 -0800
+++ b/mod_websocket/mod_websocket.lua	Fri Feb 28 15:36:06 2014 +0100
@@ -242,6 +242,7 @@
 	c2s_listener.onconnect(conn);
 
 	local session = sessions[conn];
+	session._http_request_headers = request.headers;
 
 	session.secure = consider_websocket_secure or session.secure;
 
@@ -285,4 +286,11 @@
 			["GET /"] = handle_request;
 		};
 	});
+
+	module:add_item("alt-conn-method", {
+		rel = "urn:xmpp:altconnect:websocket";
+		href = module:http_url(nil, "xmpp-websocket"):gsub("^http", "ws");
+	});
 end
+
+