mirror of
https://github.com/tiennm99/ccs.git
synced 2026-09-02 18:18:43 +00:00
fix(health): correct CLIProxy port detection on macOS/Linux
Two bugs caused the health check to incorrectly report "Proxy not running": 1. lsof command used mutually exclusive flags (-t and -F) - Removed -t flag since -F already provides structured output 2. isCLIProxyProcess whitelist was missing common binary names - Added: cliproxyapi, cli-proxy-api-plus (and .exe variants) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
2c977f686a
commit
d1a0ebee61
@@ -38,7 +38,7 @@ export async function getPortProcess(port: number): Promise<PortProcess | null>
|
|||||||
*/
|
*/
|
||||||
async function getPortProcessUnix(port: number): Promise<PortProcess | null> {
|
async function getPortProcessUnix(port: number): Promise<PortProcess | null> {
|
||||||
try {
|
try {
|
||||||
const { stdout } = await execAsync(`lsof -i :${port} -sTCP:LISTEN -t -F pcn`, {
|
const { stdout } = await execAsync(`lsof -i :${port} -sTCP:LISTEN -F pcn`, {
|
||||||
timeout: 3000,
|
timeout: 3000,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -117,7 +117,7 @@ export function isCLIProxyProcess(process: PortProcess | null): boolean {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Match cli-proxy, cli-proxy.exe, cliproxy, cliproxy.exe, cli-proxy-api
|
// Match various CLIProxy binary names
|
||||||
const name = process.processName.toLowerCase();
|
const name = process.processName.toLowerCase();
|
||||||
return [
|
return [
|
||||||
'cli-proxy',
|
'cli-proxy',
|
||||||
@@ -126,6 +126,10 @@ export function isCLIProxyProcess(process: PortProcess | null): boolean {
|
|||||||
'cliproxy.exe',
|
'cliproxy.exe',
|
||||||
'cli-proxy-api',
|
'cli-proxy-api',
|
||||||
'cli-proxy-api.exe',
|
'cli-proxy-api.exe',
|
||||||
|
'cliproxyapi',
|
||||||
|
'cliproxyapi.exe',
|
||||||
|
'cli-proxy-api-plus',
|
||||||
|
'cli-proxy-api-plus.exe',
|
||||||
].includes(name);
|
].includes(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user