Skip to content

Commit 88149b6

Browse files
author
catlog22
committed
fix: 使用127.0.0.1替代localhost以确保IPv4连接,避免IPv6解析问题
1 parent 33cc451 commit 88149b6

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

.claude/commands/workflow/analyze-with-file.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ When `--yes` or `-y`: Auto-confirm exploration decisions, use recommended analys
8383

8484
Codebase exploration FIRST, then CLI analysis.
8585

86-
**Step 1: Codebase Exploration** (cli-explore-agent, parallel up to 4)
86+
**Step 1: Codebase Exploration** (cli-explore-agent, parallel up to 6)
8787

8888
- **Single**: General codebase analysis → `{sessionFolder}/exploration-codebase.json`
8989
- **Multi-perspective**: Parallel per-perspective → `{sessionFolder}/explorations/{perspective}.json`

ccw/frontend/vite.config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const basePath = process.env.VITE_BASE_URL || '/'
1414

1515
// Backend target for Vite proxy (used when directly opening the Vite dev server port).
1616
// In `ccw view`, this is set to the dashboard server port so /api and /ws route correctly.
17-
const backendHost = process.env.VITE_BACKEND_HOST || 'localhost'
17+
// Use 127.0.0.1 instead of localhost to ensure IPv4 connection (avoid IPv6 resolution issues)
18+
const backendHost = process.env.VITE_BACKEND_HOST || '127.0.0.1'
1819
const backendPort = Number(process.env.VITE_BACKEND_PORT || '3456')
1920
const backendHttpTarget = `http://${backendHost}:${backendPort}`
2021
const backendWsTarget = `ws://${backendHost}:${backendPort}`

ccw/src/core/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ export async function startServer(options: ServerOptions = {}): Promise<http.Ser
771771
}
772772

773773
// Otherwise, proxy to Vite dev server
774-
const reactUrl = `http://localhost:${reactPort}${pathname}${url.search}`;
774+
const reactUrl = `http://127.0.0.1:${reactPort}${pathname}${url.search}`;
775775

776776
try {
777777
// Convert headers to plain object for fetch
@@ -783,7 +783,7 @@ export async function startServer(options: ServerOptions = {}): Promise<http.Ser
783783
proxyHeaders[key] = value.join(', ');
784784
}
785785
}
786-
proxyHeaders['host'] = `localhost:${reactPort}`;
786+
proxyHeaders['host'] = `127.0.0.1:${reactPort}`;
787787

788788
const reactResponse = await fetch(reactUrl, {
789789
method: req.method,

0 commit comments

Comments
 (0)