增加websocket

This commit is contained in:
Dev User
2026-08-04 17:03:30 +08:00
parent 0e9c1accd5
commit 6955e47278

View File

@@ -0,0 +1,56 @@
local M = {}
-- ws_type
M.UPGRADE = FW_WS_UPGRADE or 0
M.MESSAGE_HEADER = FW_WS_MESSAGE_HEADER or 1
M.MESSAGE_BODY = FW_WS_MESSAGE_BODY or 2
M.CLOSE = FW_WS_CLOSE or 3
--[[
FUNCTION 取消息类型
RETURN
0 = UPGRADE
1 = MESSAGE_HEADER
2 = MESSAGE_BODY
3 = CLOSE
--]]
function M.type()
return fw_websocket:type()
end
--[[
FUNCTION 是否结束帧
--]]
function M.final()
return fw_websocket:final()
end
--[[
FUNCTION 取帧操作码
RETURN
0x0 连续帧
0x1 文本帧
0x2 二进制帧
0x8 连接关闭
0x9 ping
0xA pong
--]]
function M.opcode()
return fw_websocket:opcode()
end
--[[
FUNCTION 取载荷长度
--]]
function M.length()
return fw_websocket:length()
end
--[[
FUNCTION 取掩码 (4字节表下标1~4)
--]]
function M.mask()
return fw_websocket:mask()
end
return M