openzoo 0.29.5 → 0.29.7
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/lib/hosts.js +22 -3
- package/package.json +1 -1
package/lib/hosts.js
CHANGED
|
@@ -155,9 +155,23 @@ export function bindBackend443(modelsPath, logPath, log = console.log) {
|
|
|
155
155
|
log(` "${node}" "${script}" 443 "${modelsPath}" "${logPath}"`);
|
|
156
156
|
return { ok: false, manual: true };
|
|
157
157
|
}
|
|
158
|
-
//
|
|
158
|
+
// KILL THE OLD ROOT BACKEND FIRST, HARD, AND WAIT FOR 443 TO FREE.
|
|
159
|
+
// A prior version's root-owned listener keeps holding 443; `pkill openzoo` as
|
|
160
|
+
// the user cannot touch it, so the new backend hit "port taken" and the OLD,
|
|
161
|
+
// broken one kept answering — the reason a fix looked like it never landed.
|
|
162
|
+
// We SIGKILL by name AND by whoever holds 443, poll until the port is actually
|
|
163
|
+
// free (up to ~5s), then start the new one.
|
|
164
|
+
// FLUSH THE OLD pfctl 443->8443 REDIRECT FIRST. Versions 0.29.0-0.29.2 installed
|
|
165
|
+
// a pf anchor that redirects 443 to a stale user-process backend on 8443. While
|
|
166
|
+
// that rule is loaded, pf intercepts 443 BEFORE our new root bind ever sees it,
|
|
167
|
+
// so every fix looked like it never landed. Flush the anchor + kill 8443 + kill
|
|
168
|
+
// 443 by name and by port, wait for both to free, THEN bind.
|
|
169
|
+
const flushPf = process.platform === 'darwin' ? 'pfctl -a openzoo -F all 2>/dev/null; ' : '';
|
|
159
170
|
const ok = privileged(
|
|
160
|
-
|
|
171
|
+
flushPf
|
|
172
|
+
+ `pkill -9 -f 'cursor-backend.js' 2>/dev/null; `
|
|
173
|
+
+ `for p in $(lsof -nP -iTCP:443 -sTCP:LISTEN -t 2>/dev/null) $(lsof -nP -iTCP:8443 -sTCP:LISTEN -t 2>/dev/null); do kill -9 "$p" 2>/dev/null; done; `
|
|
174
|
+
+ `for i in 1 2 3 4 5 6 7 8 9 10; do lsof -nP -iTCP:443 -sTCP:LISTEN -t >/dev/null 2>&1 || break; sleep 0.5; done; `
|
|
161
175
|
+ `nohup '${node}' '${script}' 443 '${modelsPath}' '${logPath}' >/dev/null 2>&1 & `
|
|
162
176
|
+ 'sleep 1; true',
|
|
163
177
|
);
|
|
@@ -166,5 +180,10 @@ export function bindBackend443(modelsPath, logPath, log = console.log) {
|
|
|
166
180
|
|
|
167
181
|
export function unbindBackend443() {
|
|
168
182
|
if (WIN) return { ok: false, manual: true };
|
|
169
|
-
|
|
183
|
+
const flushPf = process.platform === 'darwin' ? 'pfctl -a openzoo -F all 2>/dev/null; ' : '';
|
|
184
|
+
return { ok: privileged(
|
|
185
|
+
flushPf
|
|
186
|
+
+ "pkill -9 -f 'cursor-backend.js' 2>/dev/null; "
|
|
187
|
+
+ 'for p in $(lsof -nP -iTCP:8443 -sTCP:LISTEN -t 2>/dev/null); do kill -9 "$p" 2>/dev/null; done; true',
|
|
188
|
+
) };
|
|
170
189
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openzoo",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.7",
|
|
4
4
|
"description": "Local x402-paying proxy + MCP server for openzoo.fun — point any OpenAI-compatible harness (Cursor, Claude Code, aider, SDKs) at localhost and it pays per call from a local burner wallet. Solana and Base rails live; Robinhood experimental.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|