A VS Code extension can read http.proxy through the configuration API:

import * as vscode from 'vscode';

const resource = vscode.window.activeTextEditor?.document.uri;
const http = vscode.workspace.getConfiguration('http', resource);
const proxyUrl = http.get<string>('proxy', '');

The section is http and the property within it is proxy. Passing the resource supplies the configuration context when resource-specific values matter.

get resolves the setting for that context. inspect('proxy') can show the values present at different supported configuration scopes when a report needs their origin.

An empty string is not evidence that VS Code connects directly. The editor can use system configuration, including automatic proxy selection. This setting is not a complete list of every destination's selected PAC result.

Reading proxyUrl also does not configure an arbitrary library launched by the extension. Apply the intended value through that HTTP client's supported interface, accounting for its environment or agent behavior.

Use onDidChangeConfiguration and affectsConfiguration('http.proxy', resource) when the extension needs to notice a change. Reconfigure the client through its lifecycle rather than treating a string read once at activation as permanently current.

Mikanda mikatakata