在这段描述中,NetworkProxy CSP 是用于配置以太网和 Wi-Fi 连接的代理服务器的服务提供商。这些设置不适用于 VPN 连接。这个 CSP 是在 Windows 10,版本 1703 中添加的。
关于这些设置的工作方式:
1. 如果启用了 auto-detect,系统会尝试找到 Proxy Auto Config (PAC) 脚本的路径并下载它。
2. 如果第一步失败并且指定了一个设置脚本,系统会尝试下载显式配置的 PAC 脚本。
3. 如果第二步失败并且指定了一个代理服务器,系统会尝试使用显式配置的代理服务器。
4. 否则,系统会尝试直接访问站点。
下表列出了 NetworkProxy 配置服务提供商节点:
| 节点 | 功能 |
|-------------|-------------------------------------------------------------------|
| ./Vendor/MSFT/NetworkProxy | 供应商 MSFT 的网络代理 |
| AutoDetect | 自动检测 |
| Scope | 范围 |
| Editions | 版本 |
| Applicable OS | 适用操作系统 |
| Device | 设备 |
| User | 用户 |
| Pro | 专业 |
| Enterprise | 企业 |
| Education | 教育 |
| Windows SE | Windows Server Enterprise |
| IoT Enterprise/IoT Enterprise LTSC | IoT Enterprise(物联网企业)和 IoT Enterprise for Long Term Servicing Channel(长期服务渠道的物联网企业) |
| Windows 10, version 1703 [10.0.15063] and later | Windows 10, version 1703(版本号为10.0.15063)及更高版本 |
在自动检测设置的情况下,系统会尝试找到PAC脚本的路径。如果启用了此功能,系统会尝试寻找代理服务器路径。代理服务器配置用于为以太网和Wi-Fi连接设置静态代理。所有协议(包括HTTP、HTTPS、FTP和SOCKS)都使用相同的代理服务器。需要注意的是,这些设置不适用于VPN连接。
代理服务器配置分为两部分:通用属性和例外属性。通用属性描述了代理服务器的基本设置,如是否启用以及适用于哪些操作系统和设备。例外属性用于指定不使用代理服务器的特定连接或协议。
以下是一个简单的示例代码,用于配置代理服务器:
```python
import os
# 检查是否启用代理服务器
proxy_enabled = int(os.environ.get("PROXY_ENABLED", "1"))
if proxy_enabled == 0:
print("Proxy server is disabled.")
elif proxy_enabled == 1:
print("Proxy server is enabled (default).")
else:
print(f"Proxy server is enabled with value {proxy_enabled}.")
# 获取适用的操作系统和设备版本
applicable_os = os.environ.get("APPLICABLE_OS", "✅ Windows SE")
print(f"Applicable OS: {applicable_os}")
# 获取适用的网络代理设置节点路径
vendor_msft_network_proxy_node = os.environ.get("VENDOR_MSFT_NETWORK_PROXY_NODE", "./Vendor/MSFT/NetworkProxy/ProxyServer")
print(f"Node for configuring a static proxy for Ethernet and Wi-Fi connections: {vendor_msft_network_proxy_node}")
```
上述代码首先检查环境变量中的"PROXY_ENABLED"值,确定代理服务器是否启用。然后,根据环境变量中的其他信息,输出适用的操作系统和设备版本,并获取适用的网络代理设置节点路径。请注意,这只是一个简单的示例,实际应用中可能需要根据具体需求进行更详细的配置。
This node allows you to specify addresses that shouldn't use the proxy server. For these addresses, the system won't use the proxy server. You can separate entries using semicolons (;).
The following fields are available in this node:
- ProxyServer/ProxyAddress: The address of the proxy server that should not be used for the specified local addresses.
- Scope: Defines the scope of the settings.
- Editions: Lists the editions for which the settings apply.
- Applicable OS: Indicates the operating systems for which these settings are applicable. The following operating systems are supported: Device, User, Pro, Enterprise, Education, Windows SE, IoT Enterprise / IoT Enterprise LTSC, and Windows 10, version 1703 [10.0.15063] and later.
- chr: This character is used to separate different entries.
You can also set the ProxyServer/UseProxyForLocalAddresses node to specify whether the proxy server should be used for local (intranet) addresses. Possible values include:
- Value: 0 (Default), meaning that the proxy server will not be used for local addresses.
## Proxy Server for Local Addresses
This section provides information about using a proxy server for local addresses.
### Use Proxy Server for Local Addresses
Using a proxy server for local addresses is recommended to improve network performance and security. To enable proxy server configuration for local addresses, set the following value in the **ProxySettingsPerUser** registry key under **Scope** > **Installation Settings** > **Network Settings** :
```plaintext
Value: "0"
```
This setting enables global, machine-wide proxy configuration when set to 0.
### Don't Use Proxy Server for Local Addresses
If you prefer not to use a proxy server for local addresses, set the following value in the **ProxySettingsPerUser** registry key under **Scope** > **Installation Settings** > **Network Settings** :
```plaintext
Value: "1" (Default)
```
Setting this value to 1 enables per-user proxy configuration instead of global machine-wide configuration.
### Proxy Settings Per User
The **ProxySettingsPerUser** registry key controls whether or not to use a proxy server for all network connections, or only for specific user connections. When set to 0, proxy configuration is enabled globally for the machine. Setting this value to 1 enables per-user proxy configuration. This feature is available in the following editions and operating systems:
- Device
- Pro
- Enterprise
- Education
- Windows SE
- IoT Enterprise / IoT Enterprise LTSC
- Windows 10, version 1803 [10.0.17134] and later
To set this registry value for your installation, navigate to `./Vendor/MSFT/NetworkProxy/ProxySettingsPerUser`.
### SetupScriptUrl
The **SetupScriptUrl** registry key specifies the address of a PAC (Proxy Auto-Config) script that you want to use. It is applicable to the following editions and operating systems:
- Device (not mentioned specifically)
- Pro (not mentioned specifically)
- Enterprise (not mentioned specifically)
- Education (not mentioned specifically)
- Windows SE (not mentioned specifically)
- IoT Enterprise / IoT Enterprise LTSC (not mentioned specifically)
- Windows 10, version 1703 [10.0.15063] and later (not mentioned specifically)
以下是重构后的文本内容:
```
Replace:
0
Replace:
1
```
以下是重构后的内容:
```xml
在此处插入代理PAC URL位置:
```
以上是根据提供的内容完成的内容重构,并保持段落结构。