From 7f67c56f7e87c4a91b05d7094d20036a745a6818 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Fri, 4 Aug 2023 10:25:41 +0200 Subject: [PATCH] frontend: allow configuration of another webrtc server url (#108) --- www/app/components/webrtc.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/app/components/webrtc.js b/www/app/components/webrtc.js index 3469cd19..02aea897 100644 --- a/www/app/components/webrtc.js +++ b/www/app/components/webrtc.js @@ -1,7 +1,7 @@ import { useEffect, useState } from "react"; import Peer from "simple-peer"; -const WebRTC_SERVER_URL = "http://127.0.0.1:1250/offer"; +const WEBRTC_SERVER_URL = process.env.NEXT_PUBLIC_WEBRTC_SERVER_URL || "http://127.0.0.1:1250/offer"; const useWebRTC = (stream) => { const [data, setData] = useState({ @@ -17,7 +17,7 @@ const useWebRTC = (stream) => { peer.on("signal", (data) => { if ("sdp" in data) { - fetch(WebRTC_SERVER_URL, { + fetch(WEBRTC_SERVER_URL, { body: JSON.stringify({ sdp: data.sdp, type: data.type,