-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Statistics #43
Comments
hi, Yannis, if you want to get the SRT statistic info please add a interface like stat_srt_post_url by yourself. |
Hello Edward, it is also empty for me as well. I don't see any sis connection info. The only modification I did was to change the stat_post_url. I can see the call being made, but there is no data. |
Same for me. Callback URL works fine, stat returns empty body. |
Hey folks - I (hopefully) fixed this in #54. Feel free to give it a try from my fork: https://github.com/odensc/srt-live-server |
Thanks, I will give this a try. |
hi, rodneyallan |
@Edward-Wu I have not had a chance to test it yet. I will try it this week. |
Hi, sls.conf : error.log says 'Connection refused': UFW is disabled! Assuming this is not a bug, appreciate comments on what may be causing the connection refused and invalid tcp. |
@konjkavi You can't request that URL from the browser, that's the URL it sends the stats to. So you need a server running on that IP that can receive the JSON POST data. |
Thanks. |
Nope sorry, I'd recommend a simple Node.js server using express to test. |
Have not worked with node.js before, but created app.js (below) on the same sls server listening on port 3000 . The publicip:3000 responds to requests, but /sls/stat still not working. Obviously my app.js is no good. Appreciate if you could post replacement lines so that I may get stat working. Thank you. const express = require('express') app.post('/sls/stat', function(request, response){ app.listen(port, () => { |
You need body-parser. This should work: const express = require("express");
const bodyParser = require("body-parser");
const app = express();
app.use(bodyParser.json());
app.post("/sls/stat", (req, res) => {
console.log(req.body)
res.sendStatus(200);
});
app.listen(3000, () => console.log("Server started")); |
Hmm... server response to http://publicip:3000/sls/stat is: "Cannot GET /sls/stat" FYI, sls server is up and ffplay currently playing srt stream from it. Furthermore, sls says: Any thoughts? |
It completed the POST request successfully. The Node.js server should have printed the JSON data to the console - do you not see that? You won't be able to GET the url, you would have to implement that (e.g assign the request body to a variable and send that back via the GET route) |
Yes, I do see the stats now in console. Thank you. Feedback: |
Something like this should work. const express = require("express");
const bodyParser = require("body-parser");
const app = express();
app.use(bodyParser.json());
let lastStats = {};
app.post("/sls/stat", (req, res) => {
lastStats = req.body;
res.sendStatus(200);
});
app.get("/sls/stat", (req, res) => res.json(lastStats));
app.listen(3000, () => console.log("Server started")); |
It does work! Much appreciated. Thank you. |
@Edward-Wu and @odensc - sorry for the long delay, but I have finally be able to test the fork and it looks like it works. [ { port: '8080', |
Hi guys. I'm pretty new to SRT but coming from an NGIN/RTMP background. How exactly are we making this happen? When I click on my link the, server says no such page exists. Firewalls are off, internet is strong and stable. Secondly, where does the code written by @odensc go? do i create a .js , paste the code and put it in the html folder? |
Hello Edward,
I would like to be able to see the SRT statistics (Dropped packages, RTT, etc...).
I configured the
stat_post_url
and my API is called all 5 seconds, however the call is empty. There are no query string nor request body. How can I now access the statistics?Cheers,
Yannis
The text was updated successfully, but these errors were encountered: