This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { WebSocketServer, WebSocketClient } from "https://deno.land/x/[email protected]/mod.ts"; | |
import { load } from "https://deno.land/[email protected]/dotenv/mod.ts"; | |
// Load and validate environment variables | |
const env = await load(); | |
const PORT = parseInt(env.PORT || "8000", 10); | |
const WS_PORT = parseInt(env.WS_PORT || "8080", 10); | |
const ALLOWED_ORIGINS = env.ALLOWED_ORIGINS || "*"; | |
const STUN_SERVER = env.STUN_SERVER || "stun:stun.l.google.com:19302"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { serve } from "https://deno.land/[email protected]/http/server.ts"; | |
import { ensureDir } from "https://deno.land/[email protected]/fs/mod.ts"; | |
const server = serve({ port: 8000 }); | |
console.log("HTTP webserver running. Access it at: http://localhost:8000/"); | |
for await (const request of server) { | |
if (request.method === "POST" && request.url === "/stream") { | |
const body = await request.json(); | |
const rtspUrl = body.rtspUrl; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
read -p 'Enter domain name: ' domain | |
# Functions | |
ok() { echo -e '\e[32m'$domain'\e[m'; } # Green | |
die() { echo -e '\e[1;31m'$domain'\e[m'; exit 1; } | |
NGINX_AVAILABLE='/etc/nginx/sites-available' | |
NGINX_ENABLED='/etc/nginx/sites-enabled' | |
WEB_DIR='/var/www' |