Software /
code /
prosody-modules
Comparison
mod_websocket/mod_websocket.lua @ 969:8eba9d4809d2
mod_websocket: Set status_code instead of status
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Sat, 06 Apr 2013 21:39:20 +0200 |
parent | 910:c469a2b2d77d |
child | 1025:b56a9aa171b3 |
comparison
equal
deleted
inserted
replaced
968:f3b0ddeebd9d | 969:8eba9d4809d2 |
---|---|
231 | 231 |
232 add_filter(sessions[conn], "bytes/out", function(data) | 232 add_filter(sessions[conn], "bytes/out", function(data) |
233 return build_frame({ FIN = true, opcode = 0x01, data = tostring(data)}); | 233 return build_frame({ FIN = true, opcode = 0x01, data = tostring(data)}); |
234 end); | 234 end); |
235 | 235 |
236 response.status = "101 Switching Protocols"; | 236 response.status_code = 101; |
237 response.headers.upgrade = "websocket"; | 237 response.headers.upgrade = "websocket"; |
238 response.headers.connection = "Upgrade"; | 238 response.headers.connection = "Upgrade"; |
239 response.headers.sec_webSocket_accept = base64(sha1(request.headers.sec_websocket_key .. "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")); | 239 response.headers.sec_webSocket_accept = base64(sha1(request.headers.sec_websocket_key .. "258EAFA5-E914-47DA-95CA-C5AB0DC85B11")); |
240 response.headers.sec_webSocket_protocol = "xmpp"; | 240 response.headers.sec_webSocket_protocol = "xmpp"; |
241 response.headers.access_control_allow_origin = cross_domain; | 241 response.headers.access_control_allow_origin = cross_domain; |