From c12524e28a0e9b17109d4e7e44ff5534e2289dc5 Mon Sep 17 00:00:00 2001 From: Chenyang Liu Date: Tue, 19 Sep 2023 19:21:07 +0800 Subject: [PATCH] Add a full url to negotiate --- .../review/web-pubsub-socket.io.api.md | 1 + .../src/SIO/components/negotiate.ts | 1 + sdk/webpubsub-socketio-extension/src/common/utils.ts | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/sdk/webpubsub-socketio-extension/review/web-pubsub-socket.io.api.md b/sdk/webpubsub-socketio-extension/review/web-pubsub-socket.io.api.md index 7525d7925..5b8b934d4 100644 --- a/sdk/webpubsub-socketio-extension/review/web-pubsub-socket.io.api.md +++ b/sdk/webpubsub-socketio-extension/review/web-pubsub-socket.io.api.md @@ -46,6 +46,7 @@ export interface NegotiateResponse { endpoint: string; path: string; token: string; + url: string; } // @public diff --git a/sdk/webpubsub-socketio-extension/src/SIO/components/negotiate.ts b/sdk/webpubsub-socketio-extension/src/SIO/components/negotiate.ts index c9831ea98..f9f471468 100644 --- a/sdk/webpubsub-socketio-extension/src/SIO/components/negotiate.ts +++ b/sdk/webpubsub-socketio-extension/src/SIO/components/negotiate.ts @@ -48,6 +48,7 @@ export function negotiate( endpoint: url.origin, path: url.pathname, token: tokenResponse.token, + url: tokenResponse.baseUrl, }; writeResponse(res, 200, message); debug("negotiate, finished"); diff --git a/sdk/webpubsub-socketio-extension/src/common/utils.ts b/sdk/webpubsub-socketio-extension/src/common/utils.ts index 3ea91e3be..249b7cc2a 100644 --- a/sdk/webpubsub-socketio-extension/src/common/utils.ts +++ b/sdk/webpubsub-socketio-extension/src/common/utils.ts @@ -63,6 +63,10 @@ export interface NegotiateResponse { * The token used to connect to Web PubSub for Socket.IO. */ token: string; + /** + * The url of Web PubSub for Socket.IO. The format is `https:///`. + */ + url: string; } /**