<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="Thu, 1 Jan 1970 00:00:00 GMT">
<script type="text/javascript">
window.onError = null;
try{ document.domain = (window.location.hostname.match(/^(\d{1,3}\.){3}\d{1,3}$/)) ? window.location.hostname : window.location.hostname.split('.').slice(-1 * Math.max(window.location.hostname.split('.').length - 1, (window.location.hostname.match(/(\w{4,}\.\w{2}|\.\w{3,})$/) ? 2 : 3))).join('.');}catch(e){}
parent.PushStream.register(this);
</script>
</head>
<body><script>p(9,'RNuCFWJh1a','Try 7!','', 'Tue, 29 Dec 2015 11:24:57 GMT', '1');</script><script>p(10,'RNuCFWJh1a','Try 8!','', 'Tue, 29 Dec 2015 11:29:18 GMT', '1');</script>
<script charset="utf-8">
function messageReceived(text, id, channel) {
console.log(text)
document.querySelector('#messages').innerHTML += id + ': ' + text + '<br>';
}
var HOST = '192.168.1.188';
var PORT = 9080;
var pushstream = new PushStream({
// host: window.location.hostname,
// port: window.location.port,
host: HOST,
port: PORT,
modes: 'websocket',
messagesPublishedAfter: 5,
messagesControlByArgument: true
});
pushstream.onmessage = messageReceived;
pushstream.addChannel('RNuCFWJh1a');
pushstream.connect();
/* Backtrack Request */
var request = new XMLHttpRequest();
request.onreadystatechange= function () {
if (request.readyState == 3) {
console.log(request.responseText);
request.abort();
}
}
request.open('GET', 'http://' + HOST + ':' + PORT + '/sub/RNuCFWJh1a', true);
request.setRequestHeader('If-Modified-Since', 'Tue, 29 Dec 2015 10:40:45 GMT');
request.setRequestHeader('If-None-Match', '1');
request.send();
</script>
--
You received this message because you are subscribed to the Google Groups "nginxpushstream" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nginxpushstre...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
location ~ /sub/(.*) {
# activate subscriber mode for this location
push_stream_subscriber;
# positional channel path
push_stream_channels_path $1;
if ($arg_tests = "on") {
push_stream_channels_path "test_$1";
}
# header to be sent when receiving new subscriber connection
push_stream_header_template "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta http-equiv=\"Cache-Control\" content=\"no-store\">\r\n<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\r\n<meta http-equiv=\"Pragma\" content=\"no-cache\">\r\n<meta http-equiv=\"Expires\" content=\"Thu, 1 Jan 1970 00:00:00 GMT\">\r\n<script type=\"text/javascript\">\r\nwindow.onError = null;\r\ntry{ document.domain = (window.location.hostname.match(/^(\d{1,3}\.){3}\d{1,3}$/)) ? window.location.hostname : window.location.hostname.split('.').slice(-1 * Math.max(window.location.hostname.split('.').length - 1, (window.location.hostname.match(/(\w{4,}\.\w{2}|\.\w{3,})$/) ? 2 : 3))).join('.');}catch(e){}\r\nparent.PushStream.register(this);\r\n</script>\r\n</head>\r\n<body>";
# message template
push_stream_message_template "<script>p(~id~,'~channel~','~text~','~event-id~', '~time~', '~tag~');</script>";
# footer to be sent when finishing subscriber connection
push_stream_footer_template "</body></html>";
# content-type
default_type "text/html; charset=utf-8";
if ($arg_qs = "on") {
push_stream_last_received_message_time "$arg_time";
push_stream_last_received_message_tag "$arg_tag";
push_stream_last_event_id "$arg_eventid";
}
}
location ~ /sub/(.*) {
# activate subscriber mode for this location
push_stream_subscriber;
# positional channel path
push_stream_channels_path $1;
if ($arg_tests = "on") {
push_stream_channels_path "test_$1";
}
# message template
push_stream_message_template "{\"id\":~id~,\"channel\":\"~channel~\",\"text\":\"~text~\", \"tag\":\"~tag~\", \"time\":\"~time~\", \"eventid\":\"~event-id~\"}";
if ($arg_qs = "on") {
push_stream_last_received_message_time "$arg_time";
push_stream_last_received_message_tag "$arg_tag";
push_stream_last_event_id "$arg_eventid";
}
}