@@ -9,7 +9,7 @@ import { getMachineId } from 'vs/base/node/id';
99import { ClientConnectionEvent , IPCServer , IServerChannel , ProxyChannel } from 'vs/base/parts/ipc/common/ipc' ;
1010import { LogsDataCleaner } from 'vs/code/electron-browser/sharedProcess/contrib/logsDataCleaner' ;
1111import { main } from 'vs/code/node/cliProcessMain' ;
12- import { Query , VscodeOptions , WorkbenchOptions } from 'vs/ipc' ;
12+ import { Query , SocketOptions , VscodeOptions , WorkbenchOptions } from 'vs/ipc' ;
1313import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
1414import { ConfigurationService } from 'vs/platform/configuration/common/configurationService' ;
1515import { ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc' ;
@@ -46,6 +46,7 @@ import { TelemetryLogAppender } from 'vs/platform/telemetry/common/telemetryLogA
4646import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService' ;
4747import { combinedAppender , NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtils' ;
4848import { AppInsightsAppender } from 'vs/platform/telemetry/node/appInsightsAppender' ;
49+ import { PtyHostService } from 'vs/platform/terminal/node/ptyHostService' ;
4950import { TelemetryChannel } from 'vs/server/common/telemetry' ;
5051import { ExtensionEnvironmentChannel , FileProviderChannel , TerminalProviderChannel } from 'vs/server/node/channel' ;
5152import { Connection , ExtensionHostConnection , ManagementConnection } from 'vs/server/node/connection' ;
@@ -57,7 +58,6 @@ import { getUriTransformer } from 'vs/server/node/util';
5758import { REMOTE_TERMINAL_CHANNEL_NAME } from 'vs/workbench/contrib/terminal/common/remoteTerminalChannel' ;
5859import { REMOTE_FILE_SYSTEM_CHANNEL_NAME } from 'vs/workbench/services/remote/common/remoteAgentFileSystemChannel' ;
5960import { RemoteExtensionLogFileName } from 'vs/workbench/services/remote/common/remoteAgentService' ;
60- import { PtyHostService } from 'vs/platform/terminal/node/ptyHostService' ;
6161
6262const commit = product . commit || 'development' ;
6363
@@ -79,7 +79,7 @@ export class Vscode {
7979 public async initialize ( options : VscodeOptions ) : Promise < WorkbenchOptions > {
8080 const transformer = getUriTransformer ( options . remoteAuthority ) ;
8181 if ( ! this . servicesPromise ) {
82- this . servicesPromise = this . initializeServices ( options . args ) ;
82+ this . servicesPromise = this . initializeServices ( options ) ;
8383 }
8484 await this . servicesPromise ;
8585 const environment = this . services . get ( IEnvironmentService ) as INativeEnvironmentService ;
@@ -116,25 +116,25 @@ export class Vscode {
116116 } ;
117117 }
118118
119- public async handleWebSocket ( socket : net . Socket , query : Query , permessageDeflate : boolean ) : Promise < true > {
119+ public async handleWebSocket ( socket : net . Socket , query : Query , options : SocketOptions ) : Promise < true > {
120120 if ( ! query . reconnectionToken ) {
121121 throw new Error ( 'Reconnection token is missing from query parameters' ) ;
122122 }
123123 const protocol = new Protocol ( socket , {
124124 reconnectionToken : < string > query . reconnectionToken ,
125125 reconnection : query . reconnection === 'true' ,
126126 skipWebSocketFrames : query . skipWebSocketFrames === 'true' ,
127- permessageDeflate,
127+ permessageDeflate : options . permessageDeflate ,
128128 } ) ;
129129 try {
130- await this . connect ( await protocol . handshake ( ) , protocol ) ;
130+ await this . connect ( await protocol . handshake ( ) , protocol , options . proxyUri ) ;
131131 } catch ( error ) {
132132 protocol . destroy ( error . message ) ;
133133 }
134134 return true ;
135135 }
136136
137- private async connect ( message : ConnectionTypeRequest , protocol : Protocol ) : Promise < void > {
137+ private async connect ( message : ConnectionTypeRequest , protocol : Protocol , proxyUri : string ) : Promise < void > {
138138 if ( product . commit && message . commit !== product . commit ) {
139139 logger . warn ( `Version mismatch (${ message . commit } instead of ${ product . commit } )` ) ;
140140 }
@@ -185,6 +185,7 @@ export class Vscode {
185185 ...message . args ,
186186 } ,
187187 this . services . get ( IEnvironmentService ) as INativeEnvironmentService ,
188+ proxyUri ,
188189 ) ;
189190 }
190191 connections . set ( token , connection ) ;
@@ -211,9 +212,9 @@ export class Vscode {
211212 // References:
212213 // ../../electron-browser/sharedProcess/sharedProcessMain.ts#L148
213214 // ../../../code/electron-main/app.ts
214- private async initializeServices ( args : NativeParsedArgs ) : Promise < void > {
215+ private async initializeServices ( options : VscodeOptions ) : Promise < void > {
215216 const productService = { _serviceBrand : undefined , ...product } ;
216- const environmentService = new NativeEnvironmentService ( args , productService ) ;
217+ const environmentService = new NativeEnvironmentService ( options . args , productService ) ;
217218
218219 await Promise . all ( [
219220 environmentService . extensionsPath ,
0 commit comments