forked from dotnet/vscode-csharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNetworkSettings.ts
More file actions
24 lines (20 loc) · 953 Bytes
/
Copy pathNetworkSettings.ts
File metadata and controls
24 lines (20 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { vscode } from "./vscodeAdapter";
export default class NetworkSettings {
constructor(public readonly proxy: string, public readonly strictSSL: boolean) {
}
}
export interface NetworkSettingsProvider {
(): NetworkSettings;
}
export function vscodeNetworkSettingsProvider(vscode: vscode): NetworkSettingsProvider {
return () => {
const config = vscode.workspace.getConfiguration();
const proxy = config.get<string>('http.proxy');
const strictSSL = config.get('http.proxyStrictSSL', true);
return new NetworkSettings(proxy, strictSSL);
};
}