diff --git a/app/upload/page.tsx b/app/upload/page.tsx index bfa5772..2314ab8 100644 --- a/app/upload/page.tsx +++ b/app/upload/page.tsx @@ -19,7 +19,7 @@ import { import { storeVideoFile } from "@/lib/video-storage" const API_URL = process.env.NEXT_PUBLIC_API_URL -const WS_URL = API_URL?.replace(/^https?:\/\//, "wss://") +const WS_URL = API_URL?.replace(/^https:\/\//, "wss://").replace(/^http:\/\//, "ws://") type DetectionType = "pothole-detection" | "sign-board-detection" | "pot-sign-detection" diff --git a/components/upload-section.tsx b/components/upload-section.tsx index 2dae39e..8917233 100644 --- a/components/upload-section.tsx +++ b/components/upload-section.tsx @@ -11,7 +11,7 @@ import { Upload, Loader2, AlertCircle } from "lucide-react" import type { DetectionData, DetectionType } from "@/lib/types" const API_URL = process.env.NEXT_PUBLIC_API_URL -const WS_URL = API_URL?.replace(/^https?:\/\//, "wss://") +const WS_URL = API_URL?.replace(/^https:\/\//, "wss://").replace(/^http:\/\//, "ws://")