portless 0.10.2 → 0.10.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.
Files changed (2) hide show
  1. package/dist/cli.js +17 -1
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -1530,6 +1530,7 @@ function startProxyServer(store, proxyPort, tld, tlsOptions, lanIp, strict) {
1530
1530
  }
1531
1531
  writeTlsMarker(store.dir, false);
1532
1532
  writeTldFile(store.dir, DEFAULT_TLD);
1533
+ writeLanMarker(store.dir, null);
1533
1534
  if (autoSyncHosts) cleanHostsFile();
1534
1535
  server.close(() => process.exit(0));
1535
1536
  setTimeout(() => process.exit(0), EXIT_TIMEOUT_MS).unref();
@@ -1565,6 +1566,9 @@ async function stopProxy(store, proxyPort, _tls) {
1565
1566
  fs4.unlinkSync(store.portFilePath);
1566
1567
  } catch {
1567
1568
  }
1569
+ writeTlsMarker(store.dir, false);
1570
+ writeTldFile(store.dir, DEFAULT_TLD);
1571
+ writeLanMarker(store.dir, null);
1568
1572
  console.log(colors_default.green(`Killed process ${pid}. Proxy stopped.`));
1569
1573
  } catch (err) {
1570
1574
  if (isErrnoException(err) && err.code === "EPERM") {
@@ -1601,6 +1605,9 @@ async function stopProxy(store, proxyPort, _tls) {
1601
1605
  if (isNaN(pid)) {
1602
1606
  console.error(colors_default.red("Corrupted PID file. Removing it."));
1603
1607
  fs4.unlinkSync(pidPath);
1608
+ writeTlsMarker(store.dir, false);
1609
+ writeTldFile(store.dir, DEFAULT_TLD);
1610
+ writeLanMarker(store.dir, null);
1604
1611
  return;
1605
1612
  }
1606
1613
  try {
@@ -1616,6 +1623,9 @@ async function stopProxy(store, proxyPort, _tls) {
1616
1623
  fs4.unlinkSync(store.portFilePath);
1617
1624
  } catch {
1618
1625
  }
1626
+ writeTlsMarker(store.dir, false);
1627
+ writeTldFile(store.dir, DEFAULT_TLD);
1628
+ writeLanMarker(store.dir, null);
1619
1629
  return;
1620
1630
  }
1621
1631
  if (!await isProxyRunning(proxyPort)) {
@@ -1626,6 +1636,9 @@ async function stopProxy(store, proxyPort, _tls) {
1626
1636
  );
1627
1637
  console.log(colors_default.yellow("Removing stale PID file."));
1628
1638
  fs4.unlinkSync(pidPath);
1639
+ writeTlsMarker(store.dir, false);
1640
+ writeTldFile(store.dir, DEFAULT_TLD);
1641
+ writeLanMarker(store.dir, null);
1629
1642
  return;
1630
1643
  }
1631
1644
  process.kill(pid, "SIGTERM");
@@ -1634,6 +1647,9 @@ async function stopProxy(store, proxyPort, _tls) {
1634
1647
  fs4.unlinkSync(store.portFilePath);
1635
1648
  } catch {
1636
1649
  }
1650
+ writeTlsMarker(store.dir, false);
1651
+ writeTldFile(store.dir, DEFAULT_TLD);
1652
+ writeLanMarker(store.dir, null);
1637
1653
  console.log(colors_default.green("Proxy stopped."));
1638
1654
  } catch (err) {
1639
1655
  if (isErrnoException(err) && err.code === "EPERM") {
@@ -2167,7 +2183,7 @@ ${colors_default.bold("Reserved names:")}
2167
2183
  process.exit(0);
2168
2184
  }
2169
2185
  function printVersion() {
2170
- console.log("0.10.2");
2186
+ console.log("0.10.3");
2171
2187
  process.exit(0);
2172
2188
  }
2173
2189
  async function handleTrust() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "portless",
3
- "version": "0.10.2",
3
+ "version": "0.10.3",
4
4
  "description": "Replace port numbers with stable, named .localhost URLs. For humans and agents.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",