diff --git a/client-protocol/LingChairClient.ts b/client-protocol/LingChairClient.ts index 543152a..b5ee2a0 100644 --- a/client-protocol/LingChairClient.ts +++ b/client-protocol/LingChairClient.ts @@ -186,7 +186,7 @@ export default class LingChairClient { throw new CallbackError(re) } getBaseHttpUrl() { - const url = new URL(this.server_url) + const url = new URL(this.client.io.opts.host || (this.server_url == '' ? `${window.location.protocol}//${window.location.host}` : this.server_url)) return (({ 'ws:': 'http:', 'wss:': 'https:',