diff --git a/apps/web/next.config.mjs b/apps/web/next.config.mjs index b71a1b1..8f27ad1 100644 --- a/apps/web/next.config.mjs +++ b/apps/web/next.config.mjs @@ -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')); diff --git a/apps/web/src/app/(ui)/(protected)/api/rtmp/publish/route.ts b/apps/web/src/app/(ui)/(protected)/api/rtmp/publish/route.ts index 7689543..5f517ed 100644 --- a/apps/web/src/app/(ui)/(protected)/api/rtmp/publish/route.ts +++ b/apps/web/src/app/(ui)/(protected)/api/rtmp/publish/route.ts @@ -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, + }, }); } \ No newline at end of file diff --git a/dev/nginx.conf b/dev/nginx.conf index 626dca3..1fb2550 100644 --- a/dev/nginx.conf +++ b/dev/nginx.conf @@ -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;