frontend: allow configuration of another webrtc server url (#108)

This commit is contained in:
2023-08-04 10:25:41 +02:00
committed by GitHub
parent d94e2911c3
commit 7f67c56f7e

View File

@@ -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,