vod-rtmp/auth/server.js

23 lines
484 B
JavaScript
Raw Normal View History

2021-10-10 11:35:17 -04:00
const express = require('express');
const app = express();
app.use(express.urlencoded());
app.post("/auth", function (req, res) {
/* This server is only available to nginx */
const streamkey = req.body.key;
/* You can make a database of users instead :) */
if (streamkey === "supersecret23") {
res.status(200).send();
return;
}
/* Reject the stream */
res.status(403).send();
});
app.listen(8000, function () {
console.log("Listening on port 8000!");
});