web & api: rename stream to tunnel

- updated the endpoint to /tunnel
- updated status to tunnel
- fixed one incorrectly named error in web
This commit is contained in:
wukko
2024-09-05 00:26:48 +06:00
parent 49460bd16d
commit fff1c6c7a6
13 changed files with 99 additions and 99 deletions

View File

@@ -141,7 +141,7 @@ export const runAPI = (express, app, __dirname) => {
});
app.post('/', apiLimiter);
app.use('/stream', apiLimiterStream);
app.use('/tunnel', apiLimiterStream);
app.use('/', express.json({ limit: 1024 }));
app.use('/', (err, _, res, next) => {
@@ -225,7 +225,7 @@ export const runAPI = (express, app, __dirname) => {
}
})
app.get('/stream', (req, res) => {
app.get('/tunnel', (req, res) => {
const id = String(req.query.id);
const exp = String(req.query.exp);
const sig = String(req.query.sig);
@@ -256,7 +256,7 @@ export const runAPI = (express, app, __dirname) => {
return stream(res, streamInfo);
})
app.get('/istream', (req, res) => {
app.get('/itunnel', (req, res) => {
if (!req.ip.endsWith('127.0.0.1')) {
return res.sendStatus(403);
}