Skip to content

[gp-cli] gp url should respect port forwarding #11849

Open
@felladrin

Description

@felladrin
Contributor

While working on Auto-forward all workspace open ports when using JetBrains IDEs #11081, we noticed that the gp preview command is converting any Localhost URL to their respective Remote URL [1].

var previewCmd = &cobra.Command{
Use: "preview <url>",
Short: "Opens a URL in the IDE's preview",
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
url := replaceLocalhostInURL(args[0])

We plan to change this behavior by making this conversion on the IDE-level instead of CLI-level. And also planning to do it only when needed, cause it's not always needed.

A sample case where this conversion is not needed is the following:
A user with JetBrains IDE starts a service on port 3000, which is automatically forwarded from the server to the user machine. But the user had the port 3000 already occupied by some other process. What JetBrains IDE does in this case is looking for the next free port (3001, for example). So whenever user runs: gp preview http://localhost:3000 it should open http://localhost:3001 on the browser.

Activity

changed the title [-][gp-cli] Move the overwriting of Localhost URL from the CLI to the IDEs[/-] [+][gp-cli] gp url should respect port forwarding[/+] on Aug 15, 2022
stale

stale commented on Nov 26, 2022

@stale
added
meta: staleThis issue/PR is stale and will be closed soon
on Nov 26, 2022
removed
meta: staleThis issue/PR is stale and will be closed soon
on Nov 29, 2022
stale

stale commented on Mar 18, 2023

@stale

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

added
meta: staleThis issue/PR is stale and will be closed soon
on Mar 18, 2023
removed
meta: staleThis issue/PR is stale and will be closed soon
on Mar 28, 2023
removed their assignment
on May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @felladrin@andreafalzetti@akosyakov@mustard-mh@jeanp413

      Issue actions

        [gp-cli] gp url should respect port forwarding · Issue #11849 · gitpod-io/gitpod