@@ -74,17 +74,26 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
74
74
===================================================================
75
75
--- code-server.orig/lib/vscode/src/vs/server/node/webClientServer.ts
76
76
+++ 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 {
78
87
rootEndpoint: base,
79
88
updateEndpoint: !this._environmentService.args['disable-update-check'] ? base + '/update/check' : undefined,
80
89
logoutEndpoint: this._environmentService.args['auth'] && this._environmentService.args['auth'] !== "none" ? base + '/logout' : undefined,
81
90
+ proxyEndpointTemplate: base + '/proxy/{{port}}',
91
+ + proxyDomain: this._environmentService.args['proxyDomain'] ? `{{port}}.${this._environmentService.args['proxyDomain'][0]}` : undefined,
82
92
embedderIdentifier: 'server-distro',
83
93
extensionsGallery: this._productService.extensionsGallery,
84
94
},
85
95
- callbackRoute: this._callbackRoute
86
96
+ callbackRoute: this._callbackRoute,
87
- + proxyDomain: this._environmentService.args['proxyDomain'] ? `{{port}}.${this._environmentService.args['proxyDomain']}` : undefined
88
97
};
89
98
90
99
const nlsBaseUrl = this._productService.extensionsGallery?.nlsBaseUrl;
@@ -126,7 +135,7 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
126
135
127
136
interface ICredential {
128
137
service: string;
129
- @@ -507,6 +508,21 @@ function doCreateUri(path: string, query
138
+ @@ -507,6 +508,23 @@ function doCreateUri(path: string, query
130
139
} : undefined,
131
140
workspaceProvider: WorkspaceProvider.create(config),
132
141
urlCallbackProvider: new LocalStorageURLCallbackProvider(config.callbackRoute),
@@ -136,8 +145,10 @@ Index: code-server/lib/vscode/src/vs/code/browser/workbench/workbench.ts
136
145
+ let resolvedUri = uri
137
146
+ const localhostMatch = extractLocalHostUriMetaDataForPortMapping(uri)
138
147
+
148
+ + console.log(config.proxyDomain, "proxyDomain where you at", config.productConfiguration?.proxyDomain)
139
149
+ if (localhostMatch) {
140
150
+ if (config.productConfiguration && config.productConfiguration.proxyEndpointTemplate) {
151
+ + // TODO@jsjoeio here we need to check about proxyDomain
141
152
+ resolvedUri = URI.parse(new URL(config.productConfiguration.proxyEndpointTemplate.replace('{{port}}', localhostMatch.port.toString()), window.location.href).toString())
142
153
+ } else {
143
154
+ 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
149
160
+ }
150
161
});
151
162
})();
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 {
165
163
Index: code-server/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
166
164
===================================================================
167
165
--- code-server.orig/lib/vscode/src/vs/server/node/serverEnvironmentService.ts
0 commit comments