🔨(frontend) add room to ws signaling url
Add the room to the ws signaling url so that the ingress controller can route the request to the correct pod.
This commit is contained in:
@@ -6,6 +6,10 @@ export const baseApiUrl = () => {
|
||||
return `${origin}${process.env.NEXT_PUBLIC_API_URL}`;
|
||||
};
|
||||
|
||||
export const signalingUrl = () =>
|
||||
process.env.NEXT_PUBLIC_SIGNALING_URL ||
|
||||
(typeof window !== 'undefined' ? `wss://${window.location.host}/ws` : '');
|
||||
export const signalingUrl = (padId: string) => {
|
||||
const base =
|
||||
process.env.NEXT_PUBLIC_SIGNALING_URL ||
|
||||
(typeof window !== 'undefined' ? `wss://${window.location.host}/ws` : '');
|
||||
|
||||
return `${base}/${padId}`;
|
||||
};
|
||||
|
||||
@@ -31,7 +31,8 @@ export const usePadStore = create<PadStore>((set) => ({
|
||||
}
|
||||
|
||||
const provider = new WebrtcProvider(padId, doc, {
|
||||
signaling: [signalingUrl()],
|
||||
signaling: [signalingUrl(padId)],
|
||||
maxConns: 5,
|
||||
});
|
||||
|
||||
set(({ padsStore }) => {
|
||||
|
||||
Reference in New Issue
Block a user