电脑上的代理设置
在 Windows 11 和 macOS 里设置系统代理,检查 IP,并在不用时关闭。
一步步讲怎么给 Microsoft Edge 设置代理:Edge 从哪里取代理、只用一次的启动参数、账号和密码怎么办、受单位管理的电脑有什么不同、怎么验证结果,以及怎么关掉。
代理是另一台替你把请求发到互联网上的电脑;网站看到的是代理的地址,而不是你的。
HOST 和 PORT 是这台电脑的地址和“门牌号”。USERNAME 和 PASSWORD 用来证明你有权使用它。
启动参数是加在启动 Edge 的命令后面的词,例如 --proxy-server,只对这一次启动有效。
微软关于 Edge 命令行代理选项的页面写道,Edge 的网络栈默认使用系统网络设置,其中包括代理设置。通俗地说:Edge 读取 Windows 或 macOS 里保存的代理,同一份设置也会影响其他跟随系统的程序。
微软的代理支持页面还提到:通过系统设置无法指定 HTTPS 代理,需要用 PAC 文件或 Edge 自己的设置(例如命令行);使用系统设置时,不走代理的地址清单要按平台自己的规则格式来写。
Windows:微软支持页面给出的路径是,打开「设置」应用,选「网络和 Internet」,再选「代理」。Mac:苹果支持页面给出的路径是,苹果菜单、系统设置、侧边栏里的「网络」、你的网络服务、「详细信息」,再点「代理」。我读到的微软页面没有描述 Edge 自己的设置里有一个打开这个窗口的链接,所以请走系统路径。
Windows:在「手动代理设置」下,「使用代理服务器」旁边点「设置」,打开「使用代理服务器」,填「代理 IP 地址」和「端口」。Mac:把 HOST 和 PORT 同时填进「网页代理 (HTTP)」和「安全网页代理 (HTTPS)」。微软的代理支持页面说,在 Windows 的代理设置里,除 SOCKS 之外的所有栏位(包括“安全”)指的都是普通的 HTTP 代理服务器;页面没有对 Mac 的栏位这样说,苹果的页面也没有,所以两处填同一个 HTTP 地址。完整步骤见系统代理指南。
完全关闭 Edge,再打开,访问 https://ipinfo.io/json。看到的 IP 不是你自己的,说明代理生效了。
微软的 Edge 代理说明写道:多数平台的手动代理设置允许填写用户名和密码,但 Edge“没有实现这一点,也不会使用嵌在代理设置里的任何凭据”,认证走普通的凭据流程。说明里列出 HTTP 代理支持 Basic、Digest、Negotiate 和 NTLM。微软关于反复弹出代理登录框的排错页面说,认证过程没有完成时 Edge 会向你要凭据,所以出现登录框时,请填「我的资产」里的 USERNAME 和 PASSWORD。不要指望 macOS 自己代理设置里的密码框:Edge 不会使用嵌在代理设置里的凭据。
对 SOCKS5,同一份说明写的是“Edge 不支持任何 SOCKS5 认证方式”。不带账号的 SOCKS5 代理可以用;带账号密码的 SOCKS5 代理 Edge 自己用不了。需要账号密码就买 HTTP。
微软的命令行页面列出这个参数的三种写法:用分号分隔的“协议=地址”列表、对所有网址都生效的单个地址,以及 “direct://”(让所有连接都不走代理)。代理支持页面列出 Edge 认识的协议头:direct、http、https、socks4、socks5。地址前请写上协议头,免得有歧义。它给的 HTTP 代理示例是 --proxy-server="http://foo:8080"。
--no-proxy-server 让 Edge 不使用代理,即使系统里设了代理也一样,并覆盖其他代理设置。--proxy-auto-detect 让 Edge 自己去找代理设置,如果同时给了 --proxy-server 就会被忽略。--proxy-pac-url 指向一个 PAC 文件,那是一段小脚本,决定哪些地址走哪个代理。
要注意一点:微软的 Dev Proxy 页面写着“Microsoft Edge 不支持 --proxy-server 命令行参数”,并让你用系统代理设置;而微软自己的命令行页面却列出了这个参数,两个页面互相矛盾。如果这个参数在你的 Edge 上没有效果,请改用方法一。
msedge --proxy-server="http://HOST:PORT"
msedge --proxy-server="socks5://HOST:PORT"
msedge --no-proxy-server把 HOST 和 PORT 换成「我的资产」里的值。“msedge”代表你在自己系统上启动 Edge 的方式,参数写在它后面。第二行用于不带账号密码的 SOCKS5。
如果工作单位或学校的管理员设置了 ProxySettings 策略,微软说明 Edge 会忽略命令行里给出的所有代理选项。打开 edge://policy 可以看到当前生效的策略。较早的 ProxyMode、ProxyServer 策略以及不走代理地址清单的策略已标为弃用,只在没有设置 ProxySettings 时才生效。在这样的电脑上,改代理设置前请先问管理员。
微软的代理支持页面写道:发往 localhost 和链路本地地址的请求默认直连。不走代理的地址清单可以用另一个启动参数给出(名称见微软的命令行页面),它必须和 --proxy-server 一起使用,清单用分号或逗号分隔,像 *.contoso.com 这样的写法可以匹配子域名。Windows 的设置窗口里有用于同一目的的例外列表,Mac 上有填写不走代理的主机和域名的栏位。
微软列出的 Edge 扩展支持的接口里有 proxy,用来管理 Edge 的代理设置,支持 Windows、Linux 和 Mac,Manifest V2 和 V3 的扩展都能用。用它的扩展让代理只在 Edge 内生效,不改电脑设置。我读到的页面没有说明扩展怎么处理用户名和密码,请按扩展自己的说明操作。
页面会显示网站看到的 IP、国家和网络。把它和不开代理时的同一页面对比。
运行下面的 curl 命令。如果这一步失败,问题出在代理信息上,而不是 Edge。
用了启动参数,就确认 Edge 确实是带着它启动的;用了扩展,就确认扩展已开启。在工作电脑上,打开 edge://policy 看有没有策略在设置代理。
curl -x http://USERNAME:PASSWORD@HOST:PORT https://ipinfo.io/json把 HOST、PORT、USERNAME、PASSWORD 换成「我的资产」里的值。
• 系统代理:打开同一个系统窗口,把代理关掉。
• 启动参数:关闭 Edge,不带该参数重新启动,或带上 --no-proxy-server。
• 扩展:把扩展切到直连模式,或在 Edge 的扩展页面里删除它。
• 受管理的电脑:策略设置的代理只有管理员能改。
• 登录框反复弹出,或页面显示 407。代理没有接受用户名或密码,请从「我的资产」重新复制。微软的排错页面列出的原因包括:代理提供的认证方式 Edge 不接受,以及代理拒绝了这个账号。
• 带账号的 SOCKS5 不工作。这在 Edge 本身是正常的;请改用 HTTP。
• 页面打不开,Edge 提示 ERR_PROXY_CONNECTION_FAILED。微软的说明把这个提示用于连不上的代理服务器;请检查 HOST 和 PORT,并用 curl 测一下。
• IP 没变。Edge 没有重启、启动命令里没带参数,或者有扩展或策略在设置代理。
如果你希望浏览器始终使用同一个地址,静态 ISP 代理比较合适:整个租期内 IP 不变,购买时选择协议。请选 HTTP:微软的 Edge 说明写明 Edge 不支持任何 SOCKS5 认证方式,而 Proxy302 的 IP 带用户名和密码。产品本身的介绍见静态住宅代理页面。
打开静态 ISP 页面,选择国家,协议选 HTTP,再选租期和数量,核对费用后生成。
打开「我的资产」,复制 HOST、PORT、USERNAME、PASSWORD。「连接」页会用你自己的信息给出现成示例。HTTP 使用 proxy.proxy302.com 的 2222 端口。
把这些值填进电脑的代理设置(方法一)或 --proxy-server 参数(方法二),然后完全重启 Edge。
用上面的 curl 命令检查出口,并按代理位置检查指南的说明看 country 和 org 字段。
静态 ISP 的 IP 一天 0.50 美元,30 天 7.99 美元(约每天 0.27 美元),各国相同。各国库存每天变化,以下单页显示为准。没有免费试用,最小购买量是 1 个 IP、1 天。
Edge 默认使用系统网络设置,所以要在 Windows 或 macOS 里设置代理。
Edge 自己不行:微软的 Edge 说明写明 SOCKS5 不支持任何认证方式。请用 HTTP 代理。
微软的命令行页面列出了它,但微软的 Dev Proxy 页面说 Edge 不支持。可以试一下;没有效果就用系统设置。
撤销你用的方法:清掉系统设置、不带参数(或带 --no-proxy-server)重启 Edge,或把扩展切到直连。
这个浏览器的旧版帮助文档仍然保留。
官方文档 · 确认日期:
Read on 2 November 2026: schemes DIRECT, HTTP, HTTPS, SOCKSv4, SOCKSv5; HTTP proxies support Basic, Digest, Negotiate, NTLM; no authentication methods supported for SOCKSv5 in Edge; an HTTPS proxy cannot be specified through system settings; Edge does not implement credentials in manual proxy settings and will not use credentials embedded in them (authentication goes through the ordinary flow); --proxy-server example "http://foo:8080"; ERR_PROXY_CONNECTION_FAILED when the proxy is unreachable; the flag for the list of hosts that skip the proxy, <local> and *.domain patterns; localhost and link-local addresses are sent directly by default; with system proxy settings use the platform's rule format; Windows and macOS proxy fields are plain HTTP proxy identifiers except SOCKS.
It does not describe the sign-in box or any menu inside Edge. It says part of the page is based on Chromium.org material.
官方文档 · 确认日期:
Read on 2 November 2026: the Edge network stack uses the system network settings by default, including proxy settings; --no-proxy-server (overrides any other proxy settings, even if the system has a proxy), --proxy-auto-detect (ignored if --proxy-server is configured), --proxy-server in three forms (scheme=address list, one address, direct://), the flag for a list of hosts that skip the proxy (must be used with --proxy-server), --proxy-pac-url.
It does not name the executable used to start Edge and does not discuss credentials.
官方文档 · 确认日期:
Read on 2 November 2026: when ProxySettings is enabled Edge ignores all proxy-related options from the command line; it overrides the individual ProxyMode, ProxyPacUrl, ProxyServer and the list-of-hosts-that-skip-the-proxy policies. The pages for ProxyMode (https://learn.microsoft.com/en-us/deployedge/microsoft-edge-policies/proxymode), ProxyServer and the list-of-hosts policy mark them deprecated, applied only if ProxySettings is not specified.
It is an administrator reference.
官方文档 · 确认日期:
Read on 2 November 2026: Edge prompts for credentials when the authentication exchange with the proxy does not complete; causes include a proxy that offers no scheme enabled by the AuthSchemes policy and a proxy that refuses the credentials or whose authorization rule denies the account; edge://policy shows the effective ProxySettings.
Aimed at administrators with single sign-on; it does not describe a plain username-and-password proxy step by step.
官方文档 · 确认日期:
Read on 2 November 2026: the proxy API manages the proxy settings of Edge, on Windows, Linux and Mac, MV2 and MV3.
It does not describe credentials or modes.
官方文档 · 确认日期:
Read on 2 November 2026: the page states that Microsoft Edge does not support the --proxy-server command-line flag and recommends the system proxy settings. This contradicts the command-line page above.
It is about a developer tool and gives no reason for the statement.
官方文档 · 确认日期:
Read on 2 November 2026: Settings app, Network & internet, Proxy; under Manual proxy setup, Use a proxy server, Set up; the Proxy IP address and Port boxes; the exception list; the check box for local (intranet) addresses.
It has no username or password field.
官方文档 · 确认日期:
Read on 2 November 2026: Apple menu, System Settings, Network, a network service, Details, Proxies; options Web proxy (HTTP), Secure web proxy (HTTPS), SOCKS proxy; "Proxy server requires password"; a field for hosts & domains that skip the proxy.
It describes the macOS settings, not Edge.
产品观察 · 确认日期:
Product facts file of the site (checked against the console, the backend and the price table on 18-19 October 2026): prices in US$ (1 PTC = US$1), lease terms, protocols and ports, no free trial.
注册账号、充值一次,就能选动态住宅、静态 ISP 或数据中心 IP,几分钟配进你的浏览器。