mirror of
https://github.com/SrIzan10/helium.git
synced 2026-06-06 00:56:58 +00:00
15 lines
443 B
TypeScript
15 lines
443 B
TypeScript
const DEFAULT_BASE_URL = "https://helium.srizan.dev";
|
|
|
|
export function getHeliumBaseUrl(): string {
|
|
return process.env.EXPO_PUBLIC_HELIUM_BASE_URL ?? DEFAULT_BASE_URL;
|
|
}
|
|
|
|
export function getSignalingUrl(baseUrl: string = getHeliumBaseUrl()): string {
|
|
const url = new URL(baseUrl);
|
|
url.protocol = url.protocol === "https:" ? "wss:" : "ws:";
|
|
url.pathname = "/ws/signaling";
|
|
url.search = "";
|
|
url.hash = "";
|
|
return url.toString();
|
|
}
|