Skip to content

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

Closed
@bpmct

Description

@bpmct

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 :(

Metadata

Metadata

Assignees

Labels

enhancementSome improvement that isn't a feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions