Skip to content

Add automatic port fallback for server and Vite#96

Merged
Zhang-Henry merged 1 commit intomainfrom
fix/auto-port-fallback
Mar 26, 2026
Merged

Add automatic port fallback for server and Vite#96
Zhang-Henry merged 1 commit intomainfrom
fix/auto-port-fallback

Conversation

@bbsngg
Copy link
Copy Markdown
Contributor

@bbsngg bbsngg commented Mar 25, 2026

Summary

  • add shared runtime port tracking for backend and Vite dev server
  • make the backend fall back to the next available port when the requested port is occupied
  • make Vite record its actual port and dynamically proxy /api, /ws, and /shell to the backend's active port

Testing

  • npm test
  • npm run typecheck
  • manually blocked backend port 3101, then verified the server switched to 3102 and /health returned 200
  • manually blocked frontend port 5301 on both IPv4 and IPv6, then verified Vite switched to 5302 and /api/auth/status still proxied successfully to the backend

@bbsngg bbsngg requested a review from davidliuk March 25, 2026 02:01
@Zhang-Henry Zhang-Henry merged commit 88de512 into main Mar 26, 2026
1 check passed
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