socket-function 1.1.1 → 1.1.3
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/package.json +1 -1
- package/src/Zip.ts +1 -1
- package/src/nodeCache.ts +3 -1
package/package.json
CHANGED
package/src/Zip.ts
CHANGED
|
@@ -10,7 +10,7 @@ setFlag(require, "pako", "allowclient", true);
|
|
|
10
10
|
const SYNC_THRESHOLD_BYTES = 100_000_000;
|
|
11
11
|
const ZIP_SYNC_THRESHOLD_BYTES = 10_000_000;
|
|
12
12
|
|
|
13
|
-
// IMPORTANT! If this
|
|
13
|
+
// IMPORTANT! If this is slow, add a LZ4 version, which uses lz4-wasm-nodejs. This should be about 10X faster in both dcompression and decompression, only using 50% more space (which isn't great, but... if it is lagging the main thread it might be worth it).
|
|
14
14
|
export class Zip {
|
|
15
15
|
@measureFnc
|
|
16
16
|
public static async gzip(buffer: Buffer, level?: number): Promise<Buffer> {
|
package/src/nodeCache.ts
CHANGED
|
@@ -49,6 +49,8 @@ export function getNodeIdLocation(nodeId: string): { address: string, port: numb
|
|
|
49
49
|
return { address, port: parseInt(port) };
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
// NOTE: This returns the full domain.
|
|
53
|
+
// - It didn't used to, but I think it also wasn't used before, and now we're using this to find the ip.
|
|
52
54
|
export function getNodeIdDomain(nodeId: string): string {
|
|
53
55
|
let result = getNodeIdDomainMaybeUndefined(nodeId);
|
|
54
56
|
if (result === undefined) {
|
|
@@ -61,7 +63,7 @@ export function getNodeIdDomainMaybeUndefined(nodeId: string): string | undefine
|
|
|
61
63
|
if (!location) {
|
|
62
64
|
return undefined;
|
|
63
65
|
}
|
|
64
|
-
return new URL(location.address).hostname
|
|
66
|
+
return new URL("https://" + location.address).hostname;
|
|
65
67
|
}
|
|
66
68
|
|
|
67
69
|
// NOTE: CallFactory turns into an actual CallFactory when registerNodeClient is called
|