198
}
199
}
201
>
export function updateProxyConfigurationsScope(useHostProxy: boolean, useHostProxyDefault: boolean): void {
202
registerProxyConfigurations(useHostProxy, useHostProxyDefault);
203
}
205
>
export const USER_LOCAL_AND_REMOTE_SETTINGS = [
206
>
'http.proxy',
207
>
'http.proxyStrictSSL',
208
>
'http.proxyKerberosServicePrincipal',
209
>
'http.noProxy',
210
>
'http.proxyAuthorization',
211
>
'http.proxySupport',
212
>
'http.systemCertificates',
213
>
'http.systemCertificatesNode',
214
>
'http.experimental.systemCertificatesV2',
215
>
'http.fetchAdditionalSupport',
216
>
'http.experimental.networkInterfaceCheckInterval',
217
>
];
218
>
219
>
export const systemCertificatesNodeDefault = false;
220
>
221
>
let proxyConfiguration: IConfigurationNode[] = [];
222
>
let previousUseHostProxy: boolean | undefined = undefined;
223
>
let previousUseHostProxyDefault: boolean | undefined = undefined;
224
>
function registerProxyConfigurations(useHostProxy = true, useHostProxyDefault = true): void {
225
>
if (previousUseHostProxy === useHostProxy && previousUseHostProxyDefault === useHostProxyDefault) {
226
return;
227
}
229
>
previousUseHostProxy = useHostProxy;
230
>
previousUseHostProxyDefault = useHostProxyDefault;
231
>
232
>
const configurationRegistry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);
233
>
const oldProxyConfiguration = proxyConfiguration;
234
>
proxyConfiguration = [
235
>
{
236
>
id: 'http',
237
>
order: 15,
238
>
title: localize('httpConfigurationTitle', "HTTP"),
239
>
type: 'object',
240
>
scope: ConfigurationScope.MACHINE,
241
>
properties: {
242
>
'http.useLocalProxyConfiguration': {
243
>
type: 'boolean',
244
>
default: useHostProxyDefault,
245
>
markdownDescription: localize('useLocalProxy', "Controls whether in the remote extension host the local proxy configuration should be used. This setting only applies as a remote setting during [remote development](https://aka.ms/vscode-remote)."),
246
>
restricted: true
247
>
},
248
>
}
249
>
},
250
>
{
251
>
id: 'http',
252
>
order: 15,
253
>
title: localize('httpConfigurationTitle', "HTTP"),
254
>
type: 'object',
255
>
scope: ConfigurationScope.APPLICATION,
256
>
properties: {
257
>
'http.electronFetch': {
258
>
type: 'boolean',
259
>
default: false,
260
>
description: localize('electronFetch', "Controls whether use of Electron's fetch implementation instead of Node.js' should be enabled. All local extensions will get Electron's fetch implementation for the global fetch API."),
261
>
restricted: true
262
>
},
263
>
}
264
>
},
265
>
{
266
>
id: 'http',
267
>
order: 15,
268
>
title: localize('httpConfigurationTitle', "HTTP"),
269
>
type: 'object',
270
>
scope: useHostProxy ? ConfigurationScope.APPLICATION : ConfigurationScope.MACHINE,
271
>
properties: {
272
>
'http.proxy': {
273
>
type: 'string',
274
>
pattern: '^(https?|socks|socks4a?|socks5h?)://([^:]*(:[^@]*)?@)?([^:]+|\\[[:0-9a-fA-F]+\\])(:\\d+)?/?$|^$',
275
>
markdownDescription: localize('proxy', "The proxy setting to use. If not set, will be inherited from the `http_proxy` and `https_proxy` environment variables. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
276
>
restricted: true
277
>
},
278
>
'http.proxyStrictSSL': {
279
>
type: 'boolean',
280
>
default: true,
281
>
markdownDescription: localize('strictSSL', "Controls whether the proxy server certificate should be verified against the list of supplied CAs. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
282
>
restricted: true
283
>
},
284
>
'http.proxyKerberosServicePrincipal': {
285
>
type: 'string',
286
>
markdownDescription: localize('proxyKerberosServicePrincipal', "Overrides the principal service name for Kerberos authentication with the HTTP proxy. A default based on the proxy hostname is used when this is not set. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
287
>
restricted: true
288
>
},
289
>
'http.noProxy': {
290
>
type: 'array',
291
>
items: { type: 'string' },
292
>
markdownDescription: localize('noProxy', "Specifies domain names for which proxy settings should be ignored for HTTP/HTTPS requests. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
293
>
restricted: true
294
>
},
295
>
'http.proxyAuthorization': {
296
>
type: ['null', 'string'],
297
>
default: null,
298
>
markdownDescription: localize('proxyAuthorization', "The value to send as the `Proxy-Authorization` header for every network request. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
299
>
restricted: true
300
>
},
301
>
'http.proxySupport': {
302
>
type: 'string',
303
>
enum: ['off', 'on', 'fallback', 'override'],
304
>
enumDescriptions: [
305
>
localize('proxySupportOff', "Disable proxy support for extensions."),
306
>
localize('proxySupportOn', "Enable proxy support for extensions."),
307
>
localize('proxySupportFallback', "Enable proxy support for extensions, fall back to request options, when no proxy found."),
308
>
localize('proxySupportOverride', "Enable proxy support for extensions, override request options."),
309
>
],
310
>
default: 'override',
311
>
markdownDescription: localize('proxySupport', "Use the proxy support for extensions. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
312
>
restricted: true
313
>
},
314
>
'http.systemCertificates': {
315
>
type: 'boolean',
316
>
default: true,
317
>
markdownDescription: localize('systemCertificates', "Controls whether CA certificates should be loaded from the OS. On Windows and macOS, a reload of the window is required after turning this off. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
318
>
restricted: true
319
>
},
320
>
'http.systemCertificatesNode': {
321
>
type: 'boolean',
322
>
tags: ['experimental'],
323
>
default: systemCertificatesNodeDefault,
324
>
markdownDescription: localize('systemCertificatesNode', "Controls whether system certificates should be loaded using Node.js built-in support. Reload the window after changing this setting. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
325
>
restricted: true,
326
>
experiment: {
327
>
mode: 'auto'
328
>
}
329
>
},
330
>
'http.experimental.systemCertificatesV2': {
331
>
type: 'boolean',
332
>
tags: ['experimental'],
333
>
default: false,
334
>
markdownDescription: localize('systemCertificatesV2', "Controls whether experimental loading of CA certificates from the OS should be enabled. This uses a more general approach than the default implementation. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
335
>
restricted: true
336
>
},
337
>
'http.fetchAdditionalSupport': {
338
>
type: 'boolean',
339
>
default: true,
340
>
markdownDescription: localize('fetchAdditionalSupport', "Controls whether Node.js' fetch implementation should be extended with additional support. Currently proxy support ({1}) and system certificates ({2}) are added when the corresponding settings are enabled. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`', '`#http.proxySupport#`', '`#http.systemCertificates#`'),
341
>
restricted: true
342
>
},
343
>
'http.webSocketAdditionalSupport': {
344
>
type: 'boolean',
345
>
default: true,
346
>
markdownDescription: localize('webSocketAdditionalSupport', "Controls whether the built-in WebSocket implementation should be extended with additional support. Currently proxy support ({1}) and system certificates ({2}) are added when the corresponding settings are enabled. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`', '`#http.proxySupport#`', '`#http.systemCertificates#`'),
347
>
restricted: true
348
>
},
349
>
'http.experimental.networkInterfaceCheckInterval': {
350
>
type: 'number',
351
>
default: 300,
352
>
minimum: -1,
353
>
tags: ['experimental'],
354
>
markdownDescription: localize('networkInterfaceCheckInterval', "Controls the interval in seconds for checking network interface changes to invalidate the proxy cache. Set to -1 to disable. When during [remote development](https://aka.ms/vscode-remote) the {0} setting is disabled this setting can be configured in the local and the remote settings separately.", '`#http.useLocalProxyConfiguration#`'),
355
>
restricted: true,
356
>
experiment: {
357
>
mode: 'auto'
358
>
}
359
>
}
360
>
}
361
>
}
362
>
];
363
>
configurationRegistry.updateConfigurations({ add: proxyConfiguration, remove: oldProxyConfiguration });
364
>
}
365
>
366
>
registerProxyConfigurations();