🔨(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:
@@ -33,7 +33,7 @@ test.describe('Pad Editor', () => {
|
|||||||
await expect(page.locator('h2').getByText(randomPad[0])).toBeVisible();
|
await expect(page.locator('h2').getByText(randomPad[0])).toBeVisible();
|
||||||
|
|
||||||
const webSocket = await webSocketPromise;
|
const webSocket = await webSocketPromise;
|
||||||
expect(webSocket.url()).toBe('ws://localhost:4444/');
|
expect(webSocket.url()).toContain('ws://localhost:4444/');
|
||||||
|
|
||||||
const framesentPromise = webSocket.waitForEvent('framesent');
|
const framesentPromise = webSocket.waitForEvent('framesent');
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,10 @@ export const baseApiUrl = () => {
|
|||||||
return `${origin}${process.env.NEXT_PUBLIC_API_URL}`;
|
return `${origin}${process.env.NEXT_PUBLIC_API_URL}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const signalingUrl = () =>
|
export const signalingUrl = (padId: string) => {
|
||||||
process.env.NEXT_PUBLIC_SIGNALING_URL ||
|
const base =
|
||||||
(typeof window !== 'undefined' ? `wss://${window.location.host}/ws` : '');
|
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, {
|
const provider = new WebrtcProvider(padId, doc, {
|
||||||
signaling: [signalingUrl()],
|
signaling: [signalingUrl(padId)],
|
||||||
|
maxConns: 5,
|
||||||
});
|
});
|
||||||
|
|
||||||
set(({ padsStore }) => {
|
set(({ padsStore }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user