为什么 Nancy 需要本地主机的 URLACL,而 OWIN-self-host 不需要?
Why does Nancy need URLACL for localhost, when OWIN-self-host doesn't?
(再次)对 .Net 中的 http url 保留感到困惑,而当它们 are/aren 不需要时。
我创建了一个 'hello world' .net 4.5 控制台应用程序,将其配置为在 http://localhost:9001 上托管基本服务,并且 运行 作为非管理员。
当服务由 Nancy self-host 托管时,它失败并表示需要 URL 预留(netsh http add http://localhost:9001 等...)
但是,如果服务由 Nancy-hosted-in-OWIN 托管,使用 OWIN 自托管,显然不需要这样的 URL 预订 for localhost uris.
什么给了?错误是来自 Nancy 虚假的(可能是在旨在引导成功的配置检查中的误报),还是 Nancy 自托管使用了与 OWIN 自托管不同的 API 集(不知何故)更挑剔?
(注意:我知道需要预订 http://+:port and http://some.ip:port reservations, I'm trying to work out why http://localhost:port 行为似乎有所不同)
如此处所述https://github.com/NancyFx/Nancy/wiki/Self-Hosting-Nancy the default behaviour is to rewrite "http://localhost:port" to http://+:port,您可以通过传入
来禁用此功能
new HostConfiguration { RewriteLocalhost = false }
(再次)对 .Net 中的 http url 保留感到困惑,而当它们 are/aren 不需要时。
我创建了一个 'hello world' .net 4.5 控制台应用程序,将其配置为在 http://localhost:9001 上托管基本服务,并且 运行 作为非管理员。
当服务由 Nancy self-host 托管时,它失败并表示需要 URL 预留(netsh http add http://localhost:9001 等...)
但是,如果服务由 Nancy-hosted-in-OWIN 托管,使用 OWIN 自托管,显然不需要这样的 URL 预订 for localhost uris.
什么给了?错误是来自 Nancy 虚假的(可能是在旨在引导成功的配置检查中的误报),还是 Nancy 自托管使用了与 OWIN 自托管不同的 API 集(不知何故)更挑剔?
(注意:我知道需要预订 http://+:port and http://some.ip:port reservations, I'm trying to work out why http://localhost:port 行为似乎有所不同)
如此处所述https://github.com/NancyFx/Nancy/wiki/Self-Hosting-Nancy the default behaviour is to rewrite "http://localhost:port" to http://+:port,您可以通过传入
来禁用此功能new HostConfiguration { RewriteLocalhost = false }