Comparison

mod_pubsub_eventsource/mod_pubsub_eventsource.lua @ 1241:2380a5d71448

mod_pubsub_eventsource: Add CORS headers for cross-domain support
author Matthew Wild <mwild1@gmail.com>
date Mon, 02 Dec 2013 03:06:10 +0000
parent 858:28dba9608499
child 1242:4d1226220e58
comparison
equal deleted inserted replaced
1240:e0d97eb52ab8 1241:2380a5d71448
22 response._eventsource_node = node; 22 response._eventsource_node = node;
23 23
24 response.conn:write(table.concat({ 24 response.conn:write(table.concat({
25 "HTTP/1.1 200 OK"; 25 "HTTP/1.1 200 OK";
26 "Content-Type: text/event-stream"; 26 "Content-Type: text/event-stream";
27 "Access-Control-Allow-Origin: *";
28 "Access-Control-Allow-Methods: GET";
29 "Access-Control-Max-Age: 7200";
27 ""; 30 "";
28 ""; 31 "";
29 }, "\r\n")); 32 }, "\r\n"));
30 33
31 local clientlist = streams[node]; 34 local clientlist = streams[node];