Skip to content

Commit 43ea911

Browse files
committed
Add VSCODE_PROXY_URI to resolver env
Closes coder#1510.
1 parent 8f062c3 commit 43ea911

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/vscode/src/vs/platform/remote/browser/remoteAuthorityResolverService.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { RemoteAuthorities } from 'vs/base/common/network';
88
import { URI } from 'vs/base/common/uri';
99
import { Emitter } from 'vs/base/common/event';
1010
import { Disposable } from 'vs/base/common/lifecycle';
11+
import { Options } from 'vs/ipc';
12+
import { getOptions } from 'vs/server/common/util';
1113

1214
export class RemoteAuthorityResolverService extends Disposable implements IRemoteAuthorityResolverService {
1315

@@ -55,11 +57,14 @@ export class RemoteAuthorityResolverService extends Disposable implements IRemot
5557

5658
private _doResolveAuthority(authority: string): ResolverResult {
5759
const connectionToken = this._connectionTokens.get(authority) || this._connectionToken;
60+
// NOTE@coder: Add the proxy URI to the environment for use in the remote.
61+
const options = getOptions<Options>();
62+
const extensionHostEnv = { VSCODE_PROXY_URI: `${window.location.origin}${options.base}/proxy/{port}` };
5863
if (authority.indexOf(':') >= 0) {
5964
const pieces = authority.split(':');
60-
return { authority: { authority, host: pieces[0], port: parseInt(pieces[1], 10), connectionToken } };
65+
return { authority: { authority, host: pieces[0], port: parseInt(pieces[1], 10), connectionToken }, options: { extensionHostEnv } };
6166
}
62-
return { authority: { authority, host: authority, port: 80, connectionToken } };
67+
return { authority: { authority, host: authority, port: 80, connectionToken }, options: { extensionHostEnv } };
6368
}
6469

6570
_clearResolvedAuthority(authority: string): void {

0 commit comments

Comments
 (0)