Description
Problem
Users can't click or use localhost:PORT
links from terminal output or applications in Coder Desktop workspaces. This requires manual URL rewriting and creates a poor developer experience.
Solution
Implement true port forwarding in Coder Desktop that allows direct usage of localhost:PORT
URLs.
Requirements
- Forward
localhost:PORT
connections from the workspace to the desktop environment - Implement port forwarding to bind
localhost:PORT
to the corresponding<workspace>.coder:PORT
- Handle multiple workspace conflicts by prioritizing the most recently accessed localhost link
- Update documentation with port forwarding usage instructions
Technical Challenges
The implementation is complex due to several factors:
-
VPN Connection Limitation: Coder Connect only provides a VPN connection and doesn't have inherent knowledge of which workspace terminal output is coming from.
-
Remote SSH Complexity: When users connect to workspaces via remote SSH from local IDEs, there's no direct way for Coder Connect to track which workspace is generating localhost URLs.
-
Context Awareness: The app needs to somehow become context-aware to route localhost requests to the correct workspace.
We need to explore a fundamentally different approach that doesn't rely on tracking terminal sessions or output sources.
Success Criteria
- Clicking
localhost:PORT
links opens the correct service - Applications that auto-open localhost browser windows work as expected
- Experience mirrors local development environment
- No port conflicts between multiple workspaces