MCPcopy Index your code
hub / github.com/coder/coder / vscodeProxyURI

Function vscodeProxyURI

coderd/agentapi/manifest.go:156–167  ·  view source on GitHub ↗
(app appurl.ApplicationURL, accessURL *url.URL, appHost string)

Source from the content-addressed store, hash-verified

154}
155
156func vscodeProxyURI(app appurl.ApplicationURL, accessURL *url.URL, appHost string) string {
157 // Proxying by port only works for subdomains. If subdomain support is not
158 // available, return an empty string.
159 if appHost == "" {
160 return ""
161 }
162
163 // This will handle the ports from the accessURL or appHost.
164 appHost = appurl.SubdomainAppHost(appHost, accessURL)
165 // Return the url with a scheme and any wildcards replaced with the app slug.
166 return accessURL.Scheme + "://" + strings.ReplaceAll(appHost, "*", app.String())
167}
168
169func dbAgentMetadataToProtoDescription(metadata []database.WorkspaceAgentMetadatum) []*agentproto.WorkspaceAgentMetadata_Description {
170 ret := make([]*agentproto.WorkspaceAgentMetadata_Description, len(metadata))

Callers 2

Test_vscodeProxyURIFunction · 0.85
GetManifestMethod · 0.85

Calls 2

SubdomainAppHostFunction · 0.92
StringMethod · 0.45

Tested by 1

Test_vscodeProxyURIFunction · 0.68