@interncom/diplomatic 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +5 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8320,7 +8320,11 @@ var DiplomaticClient = class {
|
|
|
8320
8320
|
return;
|
|
8321
8321
|
}
|
|
8322
8322
|
const url = new URL(hostURL);
|
|
8323
|
-
|
|
8323
|
+
if (window.location.protocol === "https:") {
|
|
8324
|
+
url.protocol = "wss";
|
|
8325
|
+
} else {
|
|
8326
|
+
url.protocol = "ws";
|
|
8327
|
+
}
|
|
8324
8328
|
const keyHex = btoh(this.hostKeyPair?.publicKey);
|
|
8325
8329
|
url.searchParams.set("key", keyHex);
|
|
8326
8330
|
this.websocket = new WebSocket(url);
|