#5807 -- Disable EventSource on nchan due to upstream issues.

This commit is contained in:
Buster Neece 2022-10-30 13:20:47 -05:00
parent 72df7d77d9
commit 33f74430a0
No known key found for this signature in database
GPG Key ID: F1D2E64A0005E80E
2 changed files with 14 additions and 26 deletions

View File

@ -38,7 +38,9 @@ export default {
methods: {
checkNowPlaying () {
if (this.useNchan) {
this.nchan_subscriber = new NchanSubscriber(this.nowPlayingUri);
this.nchan_subscriber = new NchanSubscriber(this.nowPlayingUri, {
subscriber: ['websocket', 'longpoll']
});
this.nchan_subscriber.on('message', (message, message_metadata) => {
let np_new = JSON.parse(message);
setTimeout(() => {

View File

@ -62,22 +62,6 @@ server {
nchan_message_buffer_length 1;
nchan_message_timeout 16s;
}
location ~ /sub/([^\/]+)$ {
nchan_access_control_allow_origin "*";
nchan_subscriber;
{{if isTrue .Env.ENABLE_REDIS }}
nchan_redis_pass redis_server;
{{end}}
nchan_channel_group "azuracast_nowplaying";
nchan_channel_id "$1";
nchan_channel_id_split_delimiter ",";
nchan_subscriber_first_message -1;
}
}
server {
@ -169,18 +153,20 @@ server {
}
# Subscribe endpoint
# Workaround for https://github.com/slact/nchan/issues/534
location ~ /api/live/nowplaying/([^\/]+)$ {
include proxy_params;
nchan_access_control_allow_origin "*";
proxy_set_header If-None-Match '';
proxy_set_header If-Modified-Since '';
proxy_redirect off;
chunked_transfer_encoding off;
proxy_no_cache 1;
proxy_cache_bypass 1;
nchan_subscriber websocket longpoll chunked multipart-mixed;
proxy_pass http://127.0.0.1:6010/sub/$1;
{{if isTrue .Env.ENABLE_REDIS }}
nchan_redis_pass redis_server;
{{end}}
nchan_channel_group "azuracast_nowplaying";
nchan_channel_id "$1";
nchan_channel_id_split_delimiter ",";
nchan_subscriber_first_message -1;
}
# deny access to .htaccess files, if Apache's document root