Diff

net/websocket/frames.lua @ 6455:b6514e691a70

net.websocket: Make data masking configurable
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 26 Sep 2014 22:12:21 +0200
parent 6398:ad434f47bfc0
child 6895:f04fadabd5d9
line wrap: on
line diff
--- a/net/websocket/frames.lua	Sun Sep 28 03:06:29 2014 +0200
+++ b/net/websocket/frames.lua	Fri Sep 26 22:12:21 2014 +0200
@@ -171,7 +171,7 @@
 	return code, message
 end
 
-local function build_close(code, message)
+local function build_close(code, message, mask)
 	local data = pack_uint16be(code);
 	if message then
 		assert(#message<=123, "Close reason must be <=123 bytes");
@@ -180,7 +180,7 @@
 	return build_frame({
 		opcode = 0x8;
 		FIN = true;
-		MASK = true;
+		MASK = mask;
 		data = data;
 	});
 end