Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: delegate path based forwarding to code-server#11759

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 1 commit intomainfromstevenmasley/code-server-path-forward
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletionagent/agentssh/agentssh.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -681,7 +681,11 @@ func (s *Server) CreateCommand(ctx context.Context, script string, env []string)

// This adds the ports dialog to code-server that enables
// proxying a port dynamically.
cmd.Env = append(cmd.Env, fmt.Sprintf("VSCODE_PROXY_URI=%s", manifest.VSCodePortProxyURI))
// If this is empty string, do not set anything. Code-server auto defaults
// using its basepath to construct a path based port proxy.
if manifest.VSCodePortProxyURI != "" {
cmd.Env = append(cmd.Env, fmt.Sprintf("VSCODE_PROXY_URI=%s", manifest.VSCodePortProxyURI))
}

// Hide Coder message on code-server's "Getting Started" page
cmd.Env = append(cmd.Env, "CS_DISABLE_GETTING_STARTED_OVERRIDE=true")
Expand Down
10 changes: 6 additions & 4 deletionscoderd/agentapi/manifest.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -150,12 +150,14 @@ func (a *ManifestAPI) GetManifest(ctx context.Context, _ *agentproto.GetManifest
}

func vscodeProxyURI(app appurl.ApplicationURL, accessURL *url.URL, appHost string) string {
// This will handle the ports from the accessURL or appHost.
appHost = appurl.SubdomainAppHost(appHost, accessURL)
// If there is no appHost, then we want to use the access url as the proxy uri.
// Proxying by port only works for subdomains. If subdomain support is not
// available, return an empty string.
if appHost == "" {
appHost = accessURL.Host
return ""
}

// This will handle the ports from the accessURL or appHost.
appHost = appurl.SubdomainAppHost(appHost, accessURL)
// Return the url with a scheme and any wildcards replaced with the app slug.
return accessURL.Scheme + "://" + strings.ReplaceAll(appHost, "*", app.String())
}
Expand Down
5 changes: 2 additions & 3 deletionscoderd/agentapi/manifest_internal_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,19 +35,18 @@ func Test_vscodeProxyURI(t *testing.T) {
Expected string
}{
{
// No hostname proxies through the access url.
Name: "NoHostname",
AccessURL: coderAccessURL,
AppHostname: "",
App: basicApp,
Expected:coderAccessURL.String(),
Expected:"",
},
{
Name: "NoHostnameAccessURLPort",
AccessURL: accessURLWithPort,
AppHostname: "",
App: basicApp,
Expected:accessURLWithPort.String(),
Expected:"",
},
{
Name: "Hostname",
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp