@@ -74,17 +74,26 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
7474===================================================================
7575--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
7676+++ code-server/lib/vscode/src/vs/server/node/webClientServer.ts
77- @@ -314,10 +314,12 @@ export class WebClientServer {
77+ @@ -300,6 +300,8 @@ export class WebClientServer {
78+ const base = relativeRoot(getOriginalUrl(req))
79+ const vscodeBase = relativePath(getOriginalUrl(req))
80+
81+ + console.log("web client server, ", this._environmentService.args)
82+ +
83+ const workbenchWebConfiguration = {
84+ remoteAuthority,
85+ webviewEndpoint: vscodeBase + this._staticRoute + '/out/vs/workbench/contrib/webview/browser/pre',
86+ @@ -314,10 +316,12 @@ export class WebClientServer {
7887 rootEndpoint: base,
7988 updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
8089 logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
8190+ proxyEndpointTemplate: base + '/proxy/{{port}}',
91+ + proxyDomain: this._environmentService.args['proxyDomain'] ? `{{port}}.${this._environmentService.args['proxyDomain'][0]}` : undefined,
8292 embedderIdentifier: 'server-distro',
8393 extensionsGallery: this._productService.extensionsGallery,
8494 },
8595- callbackRoute: this._callbackRoute
8696+ callbackRoute: this._callbackRoute,
87- + proxyDomain: this._environmentService.args['proxyDomain'] ? `{{port}}.${this._environmentService.args['proxyDomain']}` : undefined
8897 };
8998
9099 const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl;
@@ -126,7 +135,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
126135
127136 interface ICredential {
128137 service: string;
129- @@ -507,6 +508,21 @@ function doCreateUri(path: string, query
138+ @@ -507,6 +508,23 @@ function doCreateUri(path: string, query
130139 } : undefined,
131140 workspaceProvider: WorkspaceProvider.create(config),
132141 urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
@@ -136,8 +145,10 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
136145+ let resolvedUri = uri
137146+ const localhostMatch = extractLocalHostUriMetaDataForPortMapping(uri)
138147+
148+ + console.log(config.proxyDomain, "proxyDomain where you at", config.productConfiguration?.proxyDomain)
139149+ if (localhostMatch) {
140150+ if (config.productConfiguration && config.productConfiguration.proxyEndpointTemplate) {
151+ + // TODO@jsjoeio here we need to check about proxyDomain
141152+ resolvedUri = URI.parse(new URL(config.productConfiguration.proxyEndpointTemplate.replace('{{port}}', localhostMatch.port.toString()), window.location.href).toString())
142153+ } else {
143154+ throw new Error(`Failed to resolve external URI: ${uri.toString()}. Could not determine base url because productConfiguration missing.`)
@@ -149,19 +160,6 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
149160+ }
150161 });
151162 })();
152- Index: code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
153- ===================================================================
154- --- code-server.orig/lib/vscode/src/vs/workbench/browser/web.api.ts
155- +++ code-server/lib/vscode/src/vs/workbench/browser/web.api.ts
156- @@ -328,6 +328,8 @@ export interface IWorkbenchConstructionO
157-
158- //#endregion
159-
160- + readonly proxyDomain?: string;
161- +
162- }
163-
164- export interface IResourceUriProvider {
165163Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
166164===================================================================
167165--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
0 commit comments