在某次打开 Fiddler Everywhere 时突然发现闪退了。去看了看日志 C:\Users\用户名\AppData\Roaming\Fiddler Everywhere\Logs,似乎是连接问题:

[2021-03-25 17:20:18:180] [error] {
  constructor: 'Error',
  stack: 'Error: Invalid protocol: 127.0.0.1:\n' +
    '    at Request.init (C:\\Users\\hjthjthjt\\AppData\\Local\\Programs\\Fiddler Everywhere\\resources\\app\\node_modules\\request\\request.js:458:31)\n' +
    '    at new Request (C:\\Users\\hjthjthjt\\AppData\\Local\\Programs\\Fiddler Everywhere\\resources\\app\\node_modules\\request\\request.js:127:8)\n' +
    '    at request (C:\\Users\\hjthjthjt\\AppData\\Local\\Programs\\Fiddler Everywhere\\resources\\app\\node_modules\\request\\index.js:53:10)\n' +
    '    at NodeHttpClient.request (C:\\Users\\hjthjthjt\\AppData\\Local\\Programs\\Fiddler Everywhere\\resources\\app\\node_modules\\request\\index.js:100:12)\n' +
    '    at C:\\Users\\hjthjthjt\\AppData\\Local\\Programs\\Fiddler Everywhere\\resources\\app\\node_modules\\@microsoft\\signalr\\dist\\cjs\\NodeHttpClient.js:63:40\n' +
    '    at new Promise (<anonymous>)\n' +
    '    at NodeHttpClient.send (C:\\Users\\hjthjthjt\\AppData\\Local\\Programs\\Fiddler Everywhere\\resources\\app\\node_modules\\@microsoft\\signalr\\dist\\cjs\\NodeHttpClient.js:55:16)\n' +
    '    at DefaultHttpClient.send (C:\\Users\\hjthjthjt\\AppData\\Local\\Programs\\Fiddler Everywhere\\resources\\app\\node_modules\\@microsoft\\signalr\\dist\\cjs\\DefaultHttpClient.js:45:32)\n' +
    '    at DefaultHttpClient.HttpClient.post (C:\\Users\\hjthjthjt\\AppData\\Local\\Programs\\Fiddler Everywhere\\resources\\app\\node_modules\\@microsoft\\signalr\\dist\\cjs\\HttpClient.js:34:21)\n' +
    '    at HttpConnection.<anonymous> (C:\\Users\\hjthjthjt\\AppData\\Local\\Programs\\Fiddler Everywhere\\resources\\app\\node_modules\\@microsoft\\signalr\\dist\\cjs\\HttpConnection.js:337:62)'
[2021-03-25 17:34:14:628] [Warning] [NETCore] Unable to bind to http://localhost:11036 on the IPv4 loopback interface: '以一种访问权限不允许的方式做了一个访问套接字的尝试。'.
[2021-03-25 17:34:14:631] [Warning] [NETCore] Unable to bind to http://localhost:11036 on the IPv6 loopback interface: '以一种访问权限不允许的方式做了一个访问套接字的尝试。'.
[2021-03-25 17:34:14:662] [Critical] [NETCore] Unable to start Kestrel.
System.IO.IOException: Failed to bind to address http://localhost:11036.
 ---> System.AggregateException: One or more errors occurred. (以一种访问权限不允许的方式做了一个访问套接字的尝试。) (以一种访问权限不允许的方式做了一个访问套接字的尝试。)
 ---> System.Net.Sockets.SocketException (10013): 以一种访问权限不允许的方式做了一个访问套接字的尝试。
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.Bind()
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportFactory.BindAsync(EndPoint endpoint, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.<>c__DisplayClass21_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.LocalhostListenOptions.BindAsync(AddressBindContext context)
   --- End of inner exception stack trace ---
 ---> (Inner Exception #1) System.Net.Sockets.SocketException (10013): 以一种访问权限不允许的方式做了一个访问套接字的尝试。
   at System.Net.Sockets.Socket.UpdateStatusAfterSocketErrorAndThrowException(SocketError error, String callerName)
   at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.Bind(EndPoint localEP)
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketConnectionListener.Bind()
   at Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets.SocketTransportFactory.BindAsync(EndPoint endpoint, CancellationToken cancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.<>c__DisplayClass21_0`1.<<StartAsync>g__OnBind|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindEndpointAsync(ListenOptions endpoint, AddressBindContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.LocalhostListenOptions.BindAsync(AddressBindContext context)<---

   --- End of inner exception stack trace ---
   at Microsoft.AspNetCore.Server.Kestrel.Core.LocalhostListenOptions.BindAsync(AddressBindContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.AddressesStrategy.BindAsync(AddressBindContext context)
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.AddressBinder.BindAsync(IServerAddressesFeature addresses, KestrelServerOptions serverOptions, ILogger logger, Func`2 createBinding)
   at Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServer.StartAsync[TContext](IHttpApplication`1 application, CancellationToken cancellationToken)

一开始猜到是代理问题,期间做了以下尝试:

  • 关闭系统代理
  • 关闭某猫猫图标软件

均无效,终于在 CMD 里

C:\Windows\system32>set http_proxy
http_proxy=127.0.0.1:7890

找了一圈,大概是一起某一次设置的时候搞的,但是似乎是错误的,必须带有 http://

于是

set http_proxy=http://127.0.0.1:7890
set https_proxy=http://127.0.0.1:7890

结果还是闪退

然后发现自己憨批了,忘了 CMD 里这么执行只能是临时……

修改环境变量即可:

另外这个问题还可能影响到其他基于 electron 的应用,毕竟报错 log 也出现在 electron.log 里了