Update server.ts
Browse files
server.ts
CHANGED
|
@@ -58,16 +58,16 @@ async function startServer() {
|
|
| 58 |
|
| 59 |
// Hugging Face Spaces injects SPACE_HOST
|
| 60 |
if (process.env.SPACE_HOST) {
|
| 61 |
-
rtmpUrl = `rtmp://${process.env.SPACE_HOST}/live`;
|
| 62 |
} else {
|
| 63 |
const appUrl = process.env.APP_URL || 'localhost';
|
| 64 |
// Determine the external URL. Note: AI Studio only exposes Port 3000 (HTTP).
|
| 65 |
// Testing RTMP from OBS externally requires running this code locally or using a TCP tunnel.
|
| 66 |
if (appUrl.startsWith('https://')) {
|
| 67 |
const hostname = new URL(appUrl).hostname;
|
| 68 |
-
rtmpUrl = `rtmp://${hostname}/live`;
|
| 69 |
} else {
|
| 70 |
-
rtmpUrl = `rtmp://${appUrl.split(':')[0]}/live`;
|
| 71 |
}
|
| 72 |
}
|
| 73 |
|
|
|
|
| 58 |
|
| 59 |
// Hugging Face Spaces injects SPACE_HOST
|
| 60 |
if (process.env.SPACE_HOST) {
|
| 61 |
+
rtmpUrl = `rtmp://${process.env.SPACE_HOST}:1935/live`;
|
| 62 |
} else {
|
| 63 |
const appUrl = process.env.APP_URL || 'localhost';
|
| 64 |
// Determine the external URL. Note: AI Studio only exposes Port 3000 (HTTP).
|
| 65 |
// Testing RTMP from OBS externally requires running this code locally or using a TCP tunnel.
|
| 66 |
if (appUrl.startsWith('https://')) {
|
| 67 |
const hostname = new URL(appUrl).hostname;
|
| 68 |
+
rtmpUrl = `rtmp://${hostname}:1935/live`;
|
| 69 |
} else {
|
| 70 |
+
rtmpUrl = `rtmp://${appUrl.split(':')[0]}:1935/live`;
|
| 71 |
}
|
| 72 |
}
|
| 73 |
|