socket-function 0.73.0 → 0.74.0
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/SocketFunction.ts +12 -0
- package/package.json +1 -1
- package/time/trueTimeShim.ts +0 -1
package/SocketFunction.ts
CHANGED
|
@@ -419,6 +419,9 @@ export class SocketFunction {
|
|
|
419
419
|
if (isNode()) {
|
|
420
420
|
throw new Error("Cannot get browser nodeId on server");
|
|
421
421
|
}
|
|
422
|
+
if (globalThis.BOOTED_EDGE_NODE) {
|
|
423
|
+
return globalThis.BOOTED_EDGE_NODE.host;
|
|
424
|
+
}
|
|
422
425
|
return SocketFunction.connect({ address: location.hostname, port: +location.port || 443 });
|
|
423
426
|
}
|
|
424
427
|
|
|
@@ -431,6 +434,15 @@ export class SocketFunction {
|
|
|
431
434
|
}
|
|
432
435
|
|
|
433
436
|
|
|
437
|
+
declare global {
|
|
438
|
+
var BOOTED_EDGE_NODE: EdgeNodeConfig | undefined;
|
|
439
|
+
}
|
|
440
|
+
type EdgeNodeConfig = {
|
|
441
|
+
// EX: 127-0-0-1.example.com:3334
|
|
442
|
+
host: string;
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
|
|
434
446
|
let socketContextSeqNum = 1;
|
|
435
447
|
|
|
436
448
|
export function _setSocketContext<T>(
|
package/package.json
CHANGED