pixifact 0.16.0 → 0.18.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.
|
@@ -277,7 +277,7 @@ export function runtimeSessionDescriptorPath(projectRoot, sessionsRoot = default
|
|
|
277
277
|
}
|
|
278
278
|
function isLoopbackOrigin(origin) {
|
|
279
279
|
const hostname = new URL(origin).hostname;
|
|
280
|
-
return hostname === 'localhost' || hostname === '::1' || hostname.startsWith('127.');
|
|
280
|
+
return hostname === 'localhost' || hostname === '[::1]' || hostname.startsWith('127.');
|
|
281
281
|
}
|
|
282
282
|
function validateRuntimeSessionDescriptor(value) {
|
|
283
283
|
if (!isRecord(value)
|
|
@@ -377,10 +377,12 @@ function serverOrigin(server) {
|
|
|
377
377
|
if (!address || typeof address === 'string') {
|
|
378
378
|
throw new Error('Pixifact Runtime requires a listening Vite HTTP server.');
|
|
379
379
|
}
|
|
380
|
-
|
|
381
|
-
|
|
380
|
+
const host = address.address === '0.0.0.0' ? '127.0.0.1'
|
|
381
|
+
: address.address === '::' ? '::1' : address.address;
|
|
382
|
+
if (!(host === '::1' || host.startsWith('127.'))) {
|
|
383
|
+
throw new Error('Pixifact Runtime requires the Vite server to bind to a loopback or wildcard address.');
|
|
382
384
|
}
|
|
383
|
-
const hostname =
|
|
385
|
+
const hostname = host === '::1' ? '[::1]' : host;
|
|
384
386
|
const protocol = server.config.server.https ? 'https' : 'http';
|
|
385
387
|
return `${protocol}://${hostname}:${address.port}`;
|
|
386
388
|
}
|
|
@@ -6,7 +6,7 @@ const injectedHot = runtimeGlobal[runtimeHotKey];
|
|
|
6
6
|
const existingRuntimeClient = runtimeGlobal[runtimeClientKey];
|
|
7
7
|
const runtimeClient = existingRuntimeClient ?? (injectedHot
|
|
8
8
|
? createPixifactRuntimeClient({
|
|
9
|
-
runtimeId: crypto.
|
|
9
|
+
runtimeId: crypto.getRandomValues(new Uint32Array(4)).join('-'),
|
|
10
10
|
hot: injectedHot,
|
|
11
11
|
console,
|
|
12
12
|
window,
|