@gethashd/bytecave-browser 1.0.56 → 1.0.58
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.
|
@@ -6251,21 +6251,7 @@ var StorageWebTransportClient = class {
|
|
|
6251
6251
|
};
|
|
6252
6252
|
}
|
|
6253
6253
|
console.log("[WebTransport] Connecting to node:", url);
|
|
6254
|
-
const
|
|
6255
|
-
if (!certHash) {
|
|
6256
|
-
return {
|
|
6257
|
-
success: false,
|
|
6258
|
-
error: "No certificate hash in WebTransport multiaddr"
|
|
6259
|
-
};
|
|
6260
|
-
}
|
|
6261
|
-
const sha256Hash = await this.certHashToSHA256(certHash);
|
|
6262
|
-
console.log("[WebTransport] Using certificate hash:", sha256Hash);
|
|
6263
|
-
const transport = new WebTransport(url, {
|
|
6264
|
-
serverCertificateHashes: [{
|
|
6265
|
-
algorithm: "sha-256",
|
|
6266
|
-
value: sha256Hash
|
|
6267
|
-
}]
|
|
6268
|
-
});
|
|
6254
|
+
const transport = new WebTransport(url);
|
|
6269
6255
|
await transport.ready;
|
|
6270
6256
|
console.log("[WebTransport] Connected, opening bidirectional stream");
|
|
6271
6257
|
const stream = await transport.createBidirectionalStream();
|
|
@@ -6328,7 +6314,8 @@ var StorageWebTransportClient = class {
|
|
|
6328
6314
|
if (!ip || !port || !hasQuic || !hasWebTransport) {
|
|
6329
6315
|
return null;
|
|
6330
6316
|
}
|
|
6331
|
-
|
|
6317
|
+
const host = ip === "127.0.0.1" ? "localhost" : ip;
|
|
6318
|
+
return `https://${host}:${port}/storage`;
|
|
6332
6319
|
} catch (error) {
|
|
6333
6320
|
console.error("[WebTransport] Failed to parse multiaddr:", error);
|
|
6334
6321
|
return null;
|
package/dist/index.cjs
CHANGED
|
@@ -6304,21 +6304,7 @@ var StorageWebTransportClient = class {
|
|
|
6304
6304
|
};
|
|
6305
6305
|
}
|
|
6306
6306
|
console.log("[WebTransport] Connecting to node:", url);
|
|
6307
|
-
const
|
|
6308
|
-
if (!certHash) {
|
|
6309
|
-
return {
|
|
6310
|
-
success: false,
|
|
6311
|
-
error: "No certificate hash in WebTransport multiaddr"
|
|
6312
|
-
};
|
|
6313
|
-
}
|
|
6314
|
-
const sha256Hash = await this.certHashToSHA256(certHash);
|
|
6315
|
-
console.log("[WebTransport] Using certificate hash:", sha256Hash);
|
|
6316
|
-
const transport = new WebTransport(url, {
|
|
6317
|
-
serverCertificateHashes: [{
|
|
6318
|
-
algorithm: "sha-256",
|
|
6319
|
-
value: sha256Hash
|
|
6320
|
-
}]
|
|
6321
|
-
});
|
|
6307
|
+
const transport = new WebTransport(url);
|
|
6322
6308
|
await transport.ready;
|
|
6323
6309
|
console.log("[WebTransport] Connected, opening bidirectional stream");
|
|
6324
6310
|
const stream = await transport.createBidirectionalStream();
|
|
@@ -6381,7 +6367,8 @@ var StorageWebTransportClient = class {
|
|
|
6381
6367
|
if (!ip || !port || !hasQuic || !hasWebTransport) {
|
|
6382
6368
|
return null;
|
|
6383
6369
|
}
|
|
6384
|
-
|
|
6370
|
+
const host = ip === "127.0.0.1" ? "localhost" : ip;
|
|
6371
|
+
return `https://${host}:${port}/storage`;
|
|
6385
6372
|
} catch (error) {
|
|
6386
6373
|
console.error("[WebTransport] Failed to parse multiaddr:", error);
|
|
6387
6374
|
return null;
|
package/dist/index.js
CHANGED
package/dist/react/index.js
CHANGED
package/package.json
CHANGED
|
@@ -59,27 +59,10 @@ export class StorageWebTransportClient {
|
|
|
59
59
|
|
|
60
60
|
console.log('[WebTransport] Connecting to node:', url);
|
|
61
61
|
|
|
62
|
-
//
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
success: false,
|
|
67
|
-
error: 'No certificate hash in WebTransport multiaddr'
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Convert base58 multihash to SHA-256 hash for serverCertificateHashes
|
|
72
|
-
const sha256Hash = await this.certHashToSHA256(certHash);
|
|
73
|
-
|
|
74
|
-
console.log('[WebTransport] Using certificate hash:', sha256Hash);
|
|
75
|
-
|
|
76
|
-
// Create WebTransport connection with self-signed certificate support
|
|
77
|
-
const transport = new WebTransport(url, {
|
|
78
|
-
serverCertificateHashes: [{
|
|
79
|
-
algorithm: 'sha-256',
|
|
80
|
-
value: sha256Hash
|
|
81
|
-
}]
|
|
82
|
-
});
|
|
62
|
+
// Create WebTransport connection
|
|
63
|
+
// For localhost development with mkcert, the certificate is trusted by the system CA
|
|
64
|
+
// For production with proper SSL, no serverCertificateHashes needed
|
|
65
|
+
const transport = new WebTransport(url);
|
|
83
66
|
await transport.ready;
|
|
84
67
|
|
|
85
68
|
console.log('[WebTransport] Connected, opening bidirectional stream');
|
|
@@ -163,8 +146,10 @@ export class StorageWebTransportClient {
|
|
|
163
146
|
return null;
|
|
164
147
|
}
|
|
165
148
|
|
|
166
|
-
// WebTransport URL format: https://
|
|
167
|
-
|
|
149
|
+
// WebTransport URL format: https://host:port/storage
|
|
150
|
+
// Use 'localhost' instead of '127.0.0.1' for better certificate compatibility
|
|
151
|
+
const host = ip === '127.0.0.1' ? 'localhost' : ip;
|
|
152
|
+
return `https://${host}:${port}/storage`;
|
|
168
153
|
|
|
169
154
|
} catch (error) {
|
|
170
155
|
console.error('[WebTransport] Failed to parse multiaddr:', error);
|