plugins/mod_websocket.lua
changeset 7917 a6eb3b6bf903
parent 7767 d6b96e42e8e6
child 7940 5b03a8003659
equal deleted inserted replaced
7916:64daa21450f9 7917:a6eb3b6bf903
   133 	return data;
   133 	return data;
   134 end
   134 end
   135 function handle_request(event)
   135 function handle_request(event)
   136 	local request, response = event.request, event.response;
   136 	local request, response = event.request, event.response;
   137 	local conn = response.conn;
   137 	local conn = response.conn;
       
   138 
       
   139 	conn.starttls = false; -- Prevent mod_tls from believing starttls can be done
   138 
   140 
   139 	if not request.headers.sec_websocket_key then
   141 	if not request.headers.sec_websocket_key then
   140 		response.headers.content_type = "text/html";
   142 		response.headers.content_type = "text/html";
   141 		return [[<!DOCTYPE html><html><head><title>Websocket</title></head><body>
   143 		return [[<!DOCTYPE html><html><head><title>Websocket</title></head><body>
   142 			<p>It works! Now point your WebSocket client to this URL to connect to Prosody.</p>
   144 			<p>It works! Now point your WebSocket client to this URL to connect to Prosody.</p>