Skip to content

[Feat]: Leverage "proxy-domain" in the "Ports" panel #5458

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

Closed
bpmct opened this issue Aug 15, 2022 · 2 comments
Closed

[Feat]: Leverage "proxy-domain" in the "Ports" panel #5458

bpmct opened this issue Aug 15, 2022 · 2 comments
Assignees
Labels
enhancement Some improvement that isn't a feature
Milestone

Comments

@bpmct
Copy link
Member

bpmct commented Aug 15, 2022

What is your suggestion?

VS Code Remote, Gitpod, and Codespaces have a lovely panel to detect and access ports via "Ports." Demonstration:

Screen.Recording.2022-08-09.at.1.41.40.PM.mov

code-server has a lesser-known "proxy-domain" feature which also allows you to access running ports running on the code-server host via a subdomain pointed to code-server (e.g. https://8080.subdomain.coder.com).

What if when a user runs an app on port 3000, code-server detects it and adds to "Ports". Also, what if you clicked "localhost:3000" from the code-server terminal, it actually goes to the proper feature.

Why do you want this feature?

Feature parity with SaaS solutions. Also, with a minor change, this would work pretty well with Coder once coder/coder#1624 is completed.

Although code-servers proxy wouldn't be directly used, Coder's proxy be and it would "just work." Right now, however, the proxy domain expects the port to be the only part of the subdomain. (e.g 8080.the-rest vs. 8080-other-stuff.the-rest)

# inside a Coder template
# see https://coder.com/docs/coder-oss/latest/templates/
resource "coder_agent" "main" {
    arch          = "amd64"
    os            = "linux"
    startup_script = <<EOF
    #!/bin/sh
    # install and start code-server
    curl -fsSL https://code-server.dev/install.sh | sh
    # set proxy-domain to the URL to access a port from a workpace inside Coder itself
    code-server --auth none --port 13337 --proxy-domain=[PORT]-main-${data.coder_workspace.me.name}-${data.coder_workspace.me.owner}.coder.example.com
    EOF
}

Are there any workarounds to get this functionality today?

Navigating to the URL directly.

Are you interested in submitting a PR for this?

I wouldn't know where to start :(

@bpmct bpmct added the enhancement Some improvement that isn't a feature label Aug 15, 2022
@jsjoeio jsjoeio added this to the On Deck milestone Aug 15, 2022
@jsjoeio
Copy link
Contributor

jsjoeio commented Aug 17, 2022

First goal of this issue is to figure out how to get the proxy domain code from vscode working inside code-server

@jsjoeio jsjoeio self-assigned this Oct 17, 2022
@jsjoeio jsjoeio modified the milestones: On Deck, October 2022 Oct 17, 2022
@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 24, 2022

Closed via #5673

@jsjoeio jsjoeio closed this as completed Oct 24, 2022
@jsjoeio jsjoeio modified the milestones: October 2022, 4.8.0 Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Development

No branches or pull requests

2 participants