fix: redirects not working correctly on programs like ffmpeg

This commit is contained in:
2025-08-23 20:13:19 +02:00
parent 6e10da6f98
commit c18cdc83b9
3 changed files with 10 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ const __dirname = path.dirname(__filename);
const LIVE_SERVER_URL =
process.env.NODE_ENV === 'production'
? 'https://backend.hctv.srizan.dev'
? 'http://nginx-rtmp:8888'
: 'http://localhost:8888';
const packageJson = JSON.parse(readFileSync('./package.json', 'utf8'));

View File

@@ -19,12 +19,10 @@ export async function POST(request: NextRequest) {
status: 403,
});
}
const headers = new Headers();
headers.append('Location', `rtmp://127.0.0.1/channel-live/${key.channel.name}`);
return new Response(null, {
return new Response('', {
status: 302,
headers: headers,
headers: {
'Location': key.channel.name,
},
});
}

View File

@@ -10,7 +10,10 @@ rtmp {
live on;
record off;
push rtmp://localhost:1935/channel-live;
on_publish http://localhost:3000/api/rtmp/publish;
deny play all;
}
application channel-live {
@@ -19,6 +22,8 @@ rtmp {
allow publish 127.0.0.1;
deny publish all;
deny play all;
hls on;
hls_type live;