@@ -42,31 +42,31 @@ Index: code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityReso
42
42
===================================================================
43
43
--- code-server.orig/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
44
44
+++ code-server/lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts
45
- @@ -8,7 +8,7 @@ import { Disposable } from 'vs/base/comm
46
- import { RemoteAuthorities } from 'vs/base/common/network';
45
+ @@ -11,7 +11,7 @@ import { StopWatch } from 'vs/base/commo
47
46
import { URI } from 'vs/base/common/uri';
47
+ import { ILogService } from 'vs/platform/log/common/log';
48
48
import { IProductService } from 'vs/platform/product/common/productService';
49
- - import { IRemoteAuthorityResolverService, IRemoteConnectionData, ResolvedAuthority, ResolverResult } from 'vs/platform/remote/common/remoteAuthorityResolver';
50
- + import { IRemoteAuthorityResolverService, IRemoteConnectionData, ResolvedAuthority, ResolvedOptions, ResolverResult } from 'vs/platform/remote/common/remoteAuthorityResolver';
49
+ - import { IRemoteAuthorityResolverService, IRemoteConnectionData, ResolvedAuthority, ResolverResult, getRemoteAuthorityPrefix } from 'vs/platform/remote/common/remoteAuthorityResolver';
50
+ + import { IRemoteAuthorityResolverService, IRemoteConnectionData, ResolvedAuthority, ResolvedOptions, ResolverResult, getRemoteAuthorityPrefix } from 'vs/platform/remote/common/remoteAuthorityResolver';
51
51
import { getRemoteServerRootPath, parseAuthorityWithOptionalPort } from 'vs/platform/remote/common/remoteHosts';
52
52
53
53
export class RemoteAuthorityResolverService extends Disposable implements IRemoteAuthorityResolverService {
54
- @@ -23,7 +23,7 @@ export class RemoteAuthorityResolverServ
55
- private readonly _connectionToken: Promise<string> | string | undefined;
56
- private readonly _connectionTokens: Map<string, string>;
57
-
58
- - constructor(@IProductService productService: IProductService, connectionToken: Promise<string> | string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined) {
59
- + constructor(@IProductService productService: IProductService, connectionToken: Promise<string> | string | undefined, resourceUriProvider: ((uri: URI) => URI) | undefined, private readonly proxyEndpointTemplate?: string) {
54
+ @@ -29,7 +29,7 @@ export class RemoteAuthorityResolverServ
55
+ constructor(
56
+ connectionToken: Promise<string> | string | undefined,
57
+ resourceUriProvider: ((uri: URI) => URI) | undefined,
58
+ - @IProductService productService: IProductService,
59
+ + @IProductService private readonly productService: IProductService,
60
+ @ILogService private readonly _logService: ILogService,
61
+ ) {
60
62
super();
61
- this._connectionToken = connectionToken;
62
- this._connectionTokens = new Map<string, string>();
63
- @@ -61,9 +61,14 @@ export class RemoteAuthorityResolverServ
64
-
65
- private async _doResolveAuthority(authority: string): Promise<ResolverResult> {
63
+ @@ -75,9 +75,14 @@ export class RemoteAuthorityResolverServ
66
64
const connectionToken = await Promise.resolve(this._connectionTokens.get(authority) || this._connectionToken);
65
+ performance.mark(`code/didResolveConnectionToken/${authorityPrefix}`);
66
+ this._logService.info(`Resolved connection token (${authorityPrefix}) after ${sw.elapsed()} ms`);
67
67
+ let options: ResolvedOptions | undefined;
68
- + if (this.proxyEndpointTemplate) {
69
- + const proxyUrl = new URL(this.proxyEndpointTemplate, window.location.href);
68
+ + if (this.productService. proxyEndpointTemplate) {
69
+ + const proxyUrl = new URL(this.productService. proxyEndpointTemplate, window.location.href);
70
70
+ options = { extensionHostEnv: { VSCODE_PROXY_URI: decodeURIComponent(proxyUrl.toString()) }}
71
71
+ }
72
72
const defaultPort = (/^https:/.test(window.location.href) ? 443 : 80);
@@ -88,24 +88,11 @@ Index: code-server/lib/vscode/src/vs/server/node/webClientServer.ts
88
88
embedderIdentifier: 'server-distro',
89
89
extensionsGallery: this._productService.extensionsGallery,
90
90
},
91
- Index: code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
92
- ===================================================================
93
- --- code-server.orig/lib/vscode/src/vs/workbench/browser/web.main.ts
94
- +++ code-server/lib/vscode/src/vs/workbench/browser/web.main.ts
95
- @@ -247,7 +247,7 @@ export class BrowserMain extends Disposa
96
-
97
- // Remote
98
- const connectionToken = environmentService.options.connectionToken || getCookieValue(connectionTokenCookieName);
99
- - const remoteAuthorityResolverService = new RemoteAuthorityResolverService(productService, connectionToken, this.configuration.resourceUriProvider);
100
- + const remoteAuthorityResolverService = new RemoteAuthorityResolverService(productService, connectionToken, this.configuration.resourceUriProvider, this.configuration.productConfiguration?.proxyEndpointTemplate);
101
- serviceCollection.set(IRemoteAuthorityResolverService, remoteAuthorityResolverService);
102
-
103
- // Signing
104
91
Index: code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
105
92
===================================================================
106
93
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
107
94
+++ code-server/lib/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.ts
108
- @@ -381 ,7 +381 ,7 @@ export async function createTerminalEnvi
95
+ @@ -383 ,7 +383 ,7 @@ export async function createTerminalEnvi
109
96
110
97
// Sanitize the environment, removing any undesirable VS Code and Electron environment
111
98
// variables
@@ -170,7 +157,7 @@ Index: code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExpl
170
157
===================================================================
171
158
--- code-server.orig/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
172
159
+++ code-server/lib/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.ts
173
- @@ -73,7 +73,7 @@ export class ForwardedPortsView extends
160
+ @@ -73,7 +73,7 @@ export class ForwardedPortsView extends
174
161
this.contextKeyListener = undefined;
175
162
}
176
163
0 commit comments