Skip to content

Commit e337741

Browse files
committed
Add VSCODE_PROXY_URI to resolver env
Closes coder#1510.
1 parent cfd9faf commit e337741

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

@@ -59,11 +61,14 @@ export class RemoteAuthorityResolverService extends Disposable implements IRemot
5961

6062
private _doResolveAuthority(authority: string): ResolverResult {
6163
const connectionToken = this._connectionTokens.get(authority) || this._connectionToken;
64+
// NOTE@coder: Add the proxy URI to the environment for use in the remote.
65+
const options = getOptions<Options>();
66+
const extensionHostEnv = { VSCODE_PROXY_URI: `${window.location.origin}${options.base}/proxy/{port}` };
6267
if (authority.indexOf(':') >= 0) {
6368
const pieces = authority.split(':');
64-
return { authority: { authority, host: pieces[0], port: parseInt(pieces[1], 10), connectionToken } };
69+
return { authority: { authority, host: pieces[0], port: parseInt(pieces[1], 10), connectionToken }, options: { extensionHostEnv } };
6570
}
66-
return { authority: { authority, host: authority, port: 80, connectionToken } };
71+
return { authority: { authority, host: authority, port: 80, connectionToken }, options: { extensionHostEnv } };
6772
}
6873

6974
_clearResolvedAuthority(authority: string): void {

0 commit comments

Comments
 (0)