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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "0.73.0",
3
+ "version": "0.74.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -68,7 +68,6 @@ export function setGetTimeOffsetBase(base: () => Promise<number>) {
68
68
  getTimeOffsetBase = base;
69
69
  }
70
70
 
71
-
72
71
  async function defaultGetTimeOffset(): Promise<number> {
73
72
  if (!isNode()) {
74
73
  let sendTime = baseGetTime();