karlheyes / icecast-kh

KH branch of icecast
GNU General Public License v2.0
300 stars 108 forks source link

where are the files /json.xsl and /stats-json.xsl? #294

Open rcasunshare opened 4 years ago

rcasunshare commented 4 years ago

Hello, where are the files /json.xsl and /stats-json.xsl? Because I can't find them. Thank you

karlheyes commented 4 years ago

if you are referring to files in the xiph tree then you should be able to copy them from there. As xsl files you can drop them in webroot and go ahead. If they are wanted more generally then they could be distributed.

karl.

peppi001 commented 3 years ago

I copied the status-json.xsl to the web directory. If I open it with browser, always ask which program to be open with. If I select Firefox, the page is opened and I see the data. But the headers are missing. I want to monitor listeners with netdata, but not working. I think the problem is the missing headers.

Peppi

image image

Roki100 commented 3 years ago

I copied the status-json.xsl to the web directory. If I open it with browser, always ask which program to be open with. If I select Firefox, the page is opened and I see the data. But the headers are missing. I want to monitor listeners with netdata, but not working. I think the problem is the missing headers.

Peppi

hello, i've encountered same problem today while trying to add my instance to netdata, so i did a temporary fix by proxying the request with this simple js script i wrote:

const express = require('express');
const http = require('http');
const xec = require('child_process').exec;

function exec(cmd, cb) {
    xec(cmd, function(error, stdout, stderr) { cb(stdout); });
}

let app = express();
let server = http.createServer(app);

app.get('/', async (req, res) => {
    exec('curl http://127.0.0.1:6969/status-json.xsl --connect-timeout 10', output => { 
        if(!output.startsWith('{"icestats":')) return; //silence non-body curl reponses
        console.log(output);
        res.type('json').end(output); 
    });
});

server.listen(6970, 'localhost');

it works, (i've set localhost:6970 as source in netdata config) like this

localserver:
  name : 'localserver'
  url  : 'http://localhost:6970'

image all it requires to run is:

peppi001 commented 3 years ago

Hello Roki100, thank you. Your solution works perfectly for me.

Daniel-Noethen commented 3 months ago

if you are referring to files in the xiph tree then you should be able to copy them from there. As xsl files you can drop them in webroot and go ahead. If they are wanted more generally then they could be distributed.

karl.

Hello Karl,

yes, please add the missing files to the web/ directory so icecast-kh is compatible with the orignal icecast. As a source client developer I currently tell my software to use the 7.xsl file if stats-json.xsl is not available. However, the 7.xsl does only expose a single mountpoint. So people will get wrong listener numbers if they are connected to a different mountpoint. Parsing stats.xsl is also not a good idea because it was written for browser access and its layout might change in the future.

Thank you, Daniel