参看
Using network loopback in side-loaded Windows Store apps - [2016-06-22]
https://learn.microsoft.com/en-us/previous-versions/windows/apps/dn640582(v=win.10)
从Win8开始,UWP默认不允许访问127.0.0.1;Edge算UWP,可用它实测之;这幺蛾子我才知道。不过Win10好像已经默认将Edge加入白名单,使得Edge可访问回环地址。系统有个自带工具CheckNetIsolation.exe,可以管理这种白名单。
$ CheckNetIsolation LoopbackExempt /?Usage:
CheckNetIsolation LoopbackExempt [operation] [-n=] [-p=]
List of operations:
-a - Add the AppContainer or Package Family to the loopback
exempted list.
-d - Delete an AppContainer or Package Family from the
loopback exempted list.
-c - Clear the list of loopback exempted AppContainers and
Package Families.
-s - Show a list of loopback exempted AppContainers and
Package Families.
List of arguments:
-n= - AppContainer Name or Package Family Name.
-p= - AppContainer or Package Family Security Identifier (SID).
-? - Displays this help message for the LoopbackExempt module.
查看白名单:
CheckNetIsolation LoopbackExempt -s
我的Win10中已有Edge。假设有用Edge访问回环地址的需求,又不在白名单中,可手工添加:
CheckNetIsolation LoopbackExempt -a -n=Microsoft.MicrosoftEdge_8wekyb3d8bbwe
如何知道"-n="的值呢?至少可用PowerShell:
Get-AppxPackage | Where-Object {$_.Name -like '*Edge*'} | Select PackageFamilyName
现在我知道下面这个设置在干啥了,就是加回环地址白名单:
Fiddler->Tools->Win8 Loopback Exemptions