Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Utility: Ports #1833

Open
Tracked by #1523
itjustcrashed opened this issue Aug 1, 2024 · 6 comments · May be fixed by #1958
Open
Tracked by #1523

✨ Utility: Ports #1833

itjustcrashed opened this issue Aug 1, 2024 · 6 comments · May be fixed by #1958
Labels
enhancement New feature or request navigator

Comments

@itjustcrashed
Copy link

itjustcrashed commented Aug 1, 2024

Description:

We should add a Ports utility to the Utility Area in CodeEdit that allows users to manage port forwarding within their development environment. This utility will make it easy for users to forward ports, monitor active ports, and configure various port-related settings from within the editor. The functionality will be visually displayed in a table where users can see port numbers, forwarded addresses, and port visibility (private or public). The user will also be able to interact with individual ports through a context menu.

Expected Behavior

  1. Ports Management Interface:
    • A dedicated utility within the Utility Area that lists forwarded ports in a table format.
    • The table should include columns for:
    • Port number
    • Forwarded address
    • Port visibility (Private or Public)
    • Origin (how the port was forwarded)
    • Status (running or stopped)
  2. Context Menu for Each Port:
    • Right-clicking (or Control-clicking) a port should bring up a context menu with the following actions:
      • Open in Browser: Opens the forwarded port in the default web browser.
      • Preview in Editor: If applicable, open the forwarded address in the editor’s built-in preview.
      • Set Port Label: Allows the user to assign a label or name to the port for easier identification.
      • Copy Local Address: Copies the local IP/hostname and port to the clipboard.
      • Port Visibility: Toggle between Private (accessible only to the local machine) and Public (accessible externally).
      • Change Port Protocol: Allow users to change the protocol used for the port (e.g., HTTP, HTTPS).
      • Stop Forwarding Port: Stops forwarding the selected port.
      • Forward a Port: Manually forward a new port by specifying the port number and address.
  3. Port Visibility and Protocol:
    • Ports can be toggled between Private (only accessible locally) and Public (accessible to other devices).
    • Users should be able to modify the protocol for a forwarded port (e.g., switching between HTTP and HTTPS).
  4. Filter/Search Ports:
    • A filter or search input should be provided at the bottom of the table to quickly find ports by number or address.
  5. Keyboard Shortcuts:
    • Consider adding keyboard shortcuts for key actions, such as stopping a port or toggling visibility.
  6. Error Handling:
    • If a port fails to forward or an error occurs during interaction, display a clear error message (e.g., “Port forwarding failed”).
    • Gracefully handle cases where a forwarded port is no longer available or conflicts arise.

Acceptance Criteria

  1. A new Ports Management Utility is available in the Utility Area where users can see and manage their forwarded ports.
  2. Users can forward new ports, stop forwarding, and toggle visibility between private and public with ease.
  3. Right-clicking a port shows a context menu with actions like Open in Browser, Preview in Editor, and Change Port Protocol.
  4. Ports can be filtered or searched for using a filter input in the interface.
  5. If a forwarded port encounters an error, the system displays a meaningful error message.
  6. The interface updates dynamically as ports are forwarded or stopped.

Screenshots

image

image

Note

Please use the ContentUnavailableView for the zero-state.

Original Issue

I have just built the latest CodeEdit build and used the new feature introduced in #1798, and I noticed that there was no menu to manage open ports. For example, if I ran a web server on http://localhost:3000, an editor like VSCode would show that there is an open port in it's status bar:

image

What if CodeEdit had open ports in the navigator?

Screenshot 2024-08-01 at 10 13 43 AM

@austincondiff
Copy link
Collaborator

Or Ports could be a utility in the utilities drawer alongside terminal debug console, and output.

@itjustcrashed
Copy link
Author

Or Ports could be a utility in the utilities drawer alongside terminal debug console, and output.

That makes a LOT more sense...

@LeonardoLarranaga
Copy link
Contributor

LeonardoLarranaga commented Oct 17, 2024

@austincondiff, Can this be assigned to me? I have some ideas and started messing around with finding opened ports and even port forwarding.

@austincondiff austincondiff changed the title ✨ Open Ports Menu ✨ Ports Utility Oct 18, 2024
@austincondiff
Copy link
Collaborator

austincondiff commented Oct 18, 2024

@LeonardoLarranaga Thanks for taking this one on! I've updated the issue description with more details and a mockup demonstrating how it might look when complete. Nothing is set in stone so please let me know if you'd like me to change anything or if you have any alternative ideas.

@austincondiff austincondiff mentioned this issue Oct 18, 2024
6 tasks
@austincondiff austincondiff moved this from 🆕 New to 🏃‍♂️ In Progress in CodeEdit Project Oct 27, 2024
@austincondiff austincondiff changed the title ✨ Ports Utility ✨ Utility: Ports Oct 27, 2024
@LeonardoLarranaga LeonardoLarranaga removed their assignment Nov 3, 2024
@itjustcrashed
Copy link
Author

@austincondiff I noticed you mainly mentioned forwarding ports. Would this mean using UPnP to open ports on the user's router, or instead could CodeEdit open and see ports opened by processes it runs? And then have other solutions like Microsoft Devtunnels available extensions.

@itjustcrashed itjustcrashed linked a pull request Jan 5, 2025 that will close this issue
11 tasks
@austincondiff
Copy link
Collaborator

austincondiff commented Jan 5, 2025

@itjustcrashed I'd imagine we would start with managing and monitoring ports opened by processes that CodeEdit directly controls, focusing on private development workflows. We'd provide optional integration with external tunneling services (e.g., Microsoft Dev Tunnels, ngrok) through extensions, ensuring secure and controlled public access. We might add UPnP support as an advanced feature for users who need it, but we would ensure it is opt-in and clearly communicates the security implications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request navigator
Projects
Status: 🏃‍♂️ In Progress
3 participants