mirror of
https://github.com/SrIzan10/hctv.git
synced 2026-06-06 00:56:56 +00:00
fix: redirects not working correctly on programs like ffmpeg
This commit is contained in:
@@ -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'));
|
||||
|
||||
@@ -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,
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user