什么URL并OWIN了解IPv6的自托管? [英] What URL does OWIN understand for ipv6 self-hosting?

查看:367
本文介绍了什么URL并OWIN了解IPv6的自托管?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序使用的ASP.NET Web API 的自托管功能。我用的NuGet包的名字是Microsoft.AspNet.WebApi.SelfHost。我用的下面的例子的位置。

My application uses self-hosting feature of ASP.NET Web API. NuGet package name I use is Microsoft.AspNet.WebApi.SelfHost. I used following example as a base.

继code ++工程对我来说,IPv4的本地主机终端推出主机:

Following code works for me to launch host on ipv4 localhost endpoint:

WebApp.Start<Startup>("http://127.0.0.1:43666");

我怎么进入,如果我想指定IPv6地址? HTTP:// [:: 1]:43666不工作。抛出异常是[格式化]:

What do I enter if I want to specify ipv6 address? "http://[::1]:43666" does not work. Exception thrown is [reformatted]:

System.Net.HttpListenerException: The network location cannot be reached. For information
   ..about network troubleshooting, see Windows Help
at System.Net.HttpListener.AddAllPrefixes()
at System.Net.HttpListener.Start()
at Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(HttpListener listener, 
   ..Func`2 appFunc, IList`1 addresses, IDictionary`2 capabilities, Func`2 loggerFactory)
at Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(Func`2 app, 
   ..IDictionary`2 properties)

我的反射器code的检查情况来看, HttpAddUrlToUrlGroup 函数返回的错误code 1232

Judging by my inspection of code in reflector, the HttpAddUrlToUrlGroup function returned error code 1232

推荐答案

我没有找到一个解决方案,但是下面是一种变通方法,但它会在所有地址上启动服务器,包括非本地和IPv4:

I did not find a solution, however following is a workaround, although it will start server on all addresses, including non-local and ipv4:

WebApp.Start<Startup>("http://+:43666");

由于这个问题,并没有产生任何兴趣,我将其关闭。

Since this question didn't generate any interest I'm closing it

这篇关于什么URL并OWIN了解IPv6的自托管?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆