diff --git a/.env.example b/.env.example index 7359d2c..6da40c1 100644 --- a/.env.example +++ b/.env.example @@ -6,6 +6,7 @@ # Used for determining the homeserver to use for short urls etc. # VITE_DEFAULT_HOMESERVER=http://localhost:8008 +# VITE_FALLBACK_STUN_ALLOWED=false # Used for submitting debug logs to an external rageshake server # VITE_RAGESHAKE_SUBMIT_URL=http://localhost:9110/api/submit diff --git a/src/ClientContext.tsx b/src/ClientContext.tsx index c7095b7..e5109b6 100644 --- a/src/ClientContext.tsx +++ b/src/ClientContext.tsx @@ -34,6 +34,7 @@ import { initClient, defaultHomeserver, CryptoStoreIntegrityError, + fallbackICEServerAllowed, } from "./matrix-utils"; import { widget } from "./widget"; import { translatedError } from "./TranslatedError"; @@ -130,6 +131,7 @@ export const ClientProvider: FC = ({ children }) => { accessToken: access_token, userId: user_id, deviceId: device_id, + fallbackICEServerAllowed: fallbackICEServerAllowed, }, true ), @@ -145,6 +147,7 @@ export const ClientProvider: FC = ({ children }) => { accessToken: access_token, userId: user_id, deviceId: device_id, + fallbackICEServerAllowed: fallbackICEServerAllowed, }, false // Don't need the crypto store just to log out ); diff --git a/src/matrix-utils.ts b/src/matrix-utils.ts index d055881..fb4b41a 100644 --- a/src/matrix-utils.ts +++ b/src/matrix-utils.ts @@ -22,6 +22,8 @@ import { getUrlParams } from "./UrlParams"; export const defaultHomeserver = (import.meta.env.VITE_DEFAULT_HOMESERVER as string) ?? `${window.location.protocol}//${window.location.host}`; +export const fallbackICEServerAllowed = + import.meta.env.VITE_FALLBACK_STUN_ALLOWED === "true"; export const defaultHomeserverHost = new URL(defaultHomeserver).host; @@ -146,6 +148,7 @@ export async function initClient( // so we don't want API calls taking ages, we'd rather they just fail. localTimeoutMs: 5000, useE2eForGroupCall: e2eEnabled, + fallbackICEServerAllowed: fallbackICEServerAllowed, }); try {