增加WEBSOCKET支持
This commit is contained in:
@@ -1,6 +1,40 @@
|
||||
local M = {}
|
||||
|
||||
|
||||
--[[
|
||||
FUNCTION: 发送响应头
|
||||
PARAM
|
||||
state_num : 状态码
|
||||
state_desc : 状态描述
|
||||
--]]
|
||||
function M.send_header(state_num, state_desc)
|
||||
return fw_response:send_header(state_num, state_desc)
|
||||
end
|
||||
|
||||
--[[
|
||||
FUNCTION: 发送WebSocket数据
|
||||
PARAM
|
||||
data : 数据
|
||||
opcode : 帧类型(可选,默认文本1;2二进制 8关闭 9ping 10pong)
|
||||
--]]
|
||||
function M.send_ws(data, opcode)
|
||||
return fw_response:send_ws(data, opcode or 1)
|
||||
end
|
||||
|
||||
--[[
|
||||
FUNCTION: 响应结束
|
||||
--]]
|
||||
function M.response_done()
|
||||
fw_response:response_done()
|
||||
end
|
||||
|
||||
--[[
|
||||
FUNCTION: 是否已响应
|
||||
--]]
|
||||
function M.is_response_done()
|
||||
return fw_response:is_response_done()
|
||||
end
|
||||
|
||||
--[[
|
||||
FUNCTION: 发送字符串
|
||||
PARAM
|
||||
|
||||
Reference in New Issue
Block a user