@bulletproof-sh/ctrl-daemon 0.0.10 → 0.0.11
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/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5087,7 +5087,9 @@ function createServer({ port, host, agents }) {
|
|
|
5087
5087
|
try {
|
|
5088
5088
|
return Bun.serve(makeServerConfig(boundPort));
|
|
5089
5089
|
} catch (err) {
|
|
5090
|
-
const
|
|
5090
|
+
const errCode = err.code ?? "";
|
|
5091
|
+
const errMsg = err instanceof Error ? err.message : "";
|
|
5092
|
+
const isAddrInUse = errCode === "EADDRINUSE" || errMsg.includes("EADDRINUSE") || errMsg.includes("address already in use");
|
|
5091
5093
|
if (!isAddrInUse || attempt === PORT_RETRY_LIMIT - 1)
|
|
5092
5094
|
throw err;
|
|
5093
5095
|
boundPort++;
|