@c4a/daemon 0.4.12-alpha.1 → 0.4.12-alpha.2

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.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -13357,7 +13357,7 @@ var assertAllowedPath = (targetPath, allowedPaths) => {
13357
13357
  };
13358
13358
 
13359
13359
  // src/config.ts
13360
- var DEFAULT_SERVER_HOST = "localhost:5100";
13360
+ var DEFAULT_SERVER_HOST = "127.0.0.1:5100";
13361
13361
  var WS_DAEMON_PATH = "/ws/daemon";
13362
13362
  function resolveServerUrl(input) {
13363
13363
  const host = input?.trim() || DEFAULT_SERVER_HOST;
@@ -13367,7 +13367,7 @@ function resolveServerUrl(input) {
13367
13367
  }
13368
13368
  const isLocal = host.startsWith("localhost") || host.startsWith("127.0.0.1") || host.startsWith("0.0.0.0");
13369
13369
  const protocol = isLocal ? "ws" : "wss";
13370
- const base2 = host.replace(/\/+$/, "");
13370
+ const base2 = host.replace(/^localhost/, "127.0.0.1").replace(/\/+$/, "");
13371
13371
  return `${protocol}://${base2}${WS_DAEMON_PATH}`;
13372
13372
  }
13373
13373
  var parseAllowedPaths = (input) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/daemon",
3
- "version": "0.4.12-alpha.1",
3
+ "version": "0.4.12-alpha.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "c4a-daemon": "./index.js"