Skip to content

Conversation

@deepracticexs
Copy link
Member

Summary

  • Remove hardcoded wsUrl from /agentx/info response
  • Frontend now always uses window.location.host to construct WebSocket URL

Problem

Bun compiler inlined process.env.NODE_ENV !== "production" as true during build, causing wsUrl to always return ws://localhost:5200/ws even in production Docker environments. This broke WebSocket connections when accessing from external hosts.

Solution

Remove wsUrl from server response entirely. This works for both:

  • Development: Vite proxy forwards /ws to backend
  • Production: Same origin, direct connection

Test Plan

  • Verified /agentx/info no longer returns wsUrl in Docker environment
  • WebSocket connection successful (confirmed by logs showing message sent to Claude)

🤖 Generated with Claude Code

…tion

Problem: Bun compiler inlined `process.env.NODE_ENV !== "production"` as `true`
during build, causing wsUrl to always return `ws://localhost:5200/ws` even in
production Docker environments. This broke WebSocket connections when accessing
from external hosts.

Solution: Remove wsUrl from server response entirely. Frontend now always uses
`window.location.host` to construct WebSocket URL. This works for both:
- Development: Vite proxy forwards /ws to backend
- Production: Same origin, direct connection

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@deepracticexs deepracticexs merged commit 8f03b12 into main Jan 9, 2026
3 checks passed
@deepracticexs deepracticexs deleted the fix/remove-wsurl-hardcode branch January 9, 2026 05:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants