squeezr-ai 1.16.9 → 1.16.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/bin/squeezr.js +32 -5
- package/package.json +1 -1
package/bin/squeezr.js
CHANGED
|
@@ -177,6 +177,16 @@ async function startDaemon() {
|
|
|
177
177
|
console.log(` HTTP proxy (Claude/Aider/Gemini): http://localhost:${port}`)
|
|
178
178
|
console.log(` MITM proxy (Codex): http://localhost:${mitmPort}`)
|
|
179
179
|
console.log(` Logs: ${logFile}`)
|
|
180
|
+
|
|
181
|
+
// Restore HTTPS_PROXY in Windows registry now that the proxy is alive
|
|
182
|
+
if (process.platform === 'win32') {
|
|
183
|
+
try { execSync(`setx HTTPS_PROXY "http://localhost:${mitmPort}"`, { stdio: 'pipe' }) } catch {}
|
|
184
|
+
} else if (isWSL()) {
|
|
185
|
+
try {
|
|
186
|
+
const setxExe = '/mnt/c/Windows/System32/setx.exe'
|
|
187
|
+
if (fs.existsSync(setxExe)) execSync(`"${setxExe}" HTTPS_PROXY "http://localhost:${mitmPort}"`, { stdio: 'pipe' })
|
|
188
|
+
} catch {}
|
|
189
|
+
}
|
|
180
190
|
}
|
|
181
191
|
|
|
182
192
|
function showLogs() {
|
|
@@ -232,6 +242,16 @@ function stopProxy() {
|
|
|
232
242
|
}
|
|
233
243
|
} catch {}
|
|
234
244
|
}
|
|
245
|
+
// Clear HTTPS_PROXY so npm and other tools don't try to use the dead proxy
|
|
246
|
+
if (process.platform === 'win32') {
|
|
247
|
+
try { execSync('setx HTTPS_PROXY ""', { stdio: 'pipe' }) } catch {}
|
|
248
|
+
} else if (isWSL()) {
|
|
249
|
+
try {
|
|
250
|
+
const setxExe = '/mnt/c/Windows/System32/setx.exe'
|
|
251
|
+
if (fs.existsSync(setxExe)) execSync(`"${setxExe}" HTTPS_PROXY ""`, { stdio: 'pipe' })
|
|
252
|
+
} catch {}
|
|
253
|
+
}
|
|
254
|
+
|
|
235
255
|
if (killed) {
|
|
236
256
|
console.log(`Squeezr stopped`)
|
|
237
257
|
console.log(` HTTP proxy (Claude/Aider/Gemini): http://localhost:${port}`)
|
|
@@ -1067,8 +1087,8 @@ switch (command) {
|
|
|
1067
1087
|
// Start the daemon directly from the new dist/index.js (no re-exec of old binary)
|
|
1068
1088
|
console.log('Starting Squeezr...')
|
|
1069
1089
|
const newDistIndex = path.join(newRoot, 'dist', 'index.js')
|
|
1070
|
-
const
|
|
1071
|
-
const
|
|
1090
|
+
const startPort = getPort()
|
|
1091
|
+
const startMitmPort = getMitmPort(startPort)
|
|
1072
1092
|
const logDir = path.join(os.homedir(), '.squeezr')
|
|
1073
1093
|
const logFile = path.join(logDir, 'squeezr.log')
|
|
1074
1094
|
fs.mkdirSync(logDir, { recursive: true })
|
|
@@ -1082,11 +1102,18 @@ switch (command) {
|
|
|
1082
1102
|
child.unref()
|
|
1083
1103
|
fs.closeSync(logFd)
|
|
1084
1104
|
console.log(`Squeezr started (pid ${child.pid})`)
|
|
1085
|
-
console.log(` HTTP proxy (Claude/Aider/Gemini): http://localhost:${
|
|
1086
|
-
console.log(` MITM proxy (Codex): http://localhost:${
|
|
1105
|
+
console.log(` HTTP proxy (Claude/Aider/Gemini): http://localhost:${startPort}`)
|
|
1106
|
+
console.log(` MITM proxy (Codex): http://localhost:${startMitmPort}`)
|
|
1087
1107
|
console.log(` Logs: ${logFile}`)
|
|
1088
1108
|
|
|
1089
|
-
|
|
1109
|
+
// Restore HTTPS_PROXY now that the proxy is alive
|
|
1110
|
+
if (process.platform === 'win32') {
|
|
1111
|
+
try { execSync(`setx HTTPS_PROXY "http://localhost:${startMitmPort}"`, { stdio: 'pipe' }) } catch {}
|
|
1112
|
+
} else if (isWSL()) {
|
|
1113
|
+
try {
|
|
1114
|
+
const setxExe = '/mnt/c/Windows/System32/setx.exe'
|
|
1115
|
+
if (fs.existsSync(setxExe)) execSync(`"${setxExe}" HTTPS_PROXY "http://localhost:${startMitmPort}"`, { stdio: 'pipe' })
|
|
1116
|
+
} catch {}
|
|
1090
1117
|
console.log('\n ⚠️ IMPORTANT: Close this terminal and open a new one so the')
|
|
1091
1118
|
console.log(' environment variables take effect. Otherwise tools like')
|
|
1092
1119
|
console.log(' Claude Code may fail with 502 errors.\n')
|
package/package.json
CHANGED