c# - Azure:监听非默认端口会导致访问被拒绝

标签 c# azure networking port azure-webjobs

我尝试运行一个简单的网络作业,该作业本质上是打开端口并监听它们的流量。我希望能够使用 80 或 443 以外的不同端口。我的代码是:

var listeningOn = string.Format("http://wwwmydomain.com:4027,
            var appHost = new AppHost();
            appHost.Init();
            appHost.Start(listeningOn);

当我启动 AppHost 时,我收到一条错误消息:

Unhandled Exception: System.Net.HttpListenerException: Access is denied [10/06/2015 15:04:49 > ccdf79: ERR ] at System.Net.HttpListener.SetupV2Config() [10/06/2015 15:04:49 > ccdf79: ERR ] at System.Net.HttpListener.Start() [10/06/2015 15:04:49 > ccdf79: ERR ] at ServiceStack.WebHost.Endpoints.Support.HttpListenerBase.Start(String urlBase)

有什么办法可以解决这个问题,或者是我使用虚拟机的唯一选择。我研究过 Azure 流量管理,但这似乎并不能真正满足我的需求。我需要使用端口 4027 有一些内部原因,这些原因超出了我的控制范围。

最佳答案

在 Azure Web Apps 上运行 Node 时,无法监听任意端口。相反,您只能监听 process.env.PORT。这实际上设置为命名管道而不是端口,但这更多的是实现细节。

关于c# - Azure:监听非默认端口会导致访问被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32974301/

相关文章:

asp.net - 将通配符 SSL 子域与 Windows Azure ASP.NET 应用程序结合使用

azure - PowerShell 任务未在 Azure Pipelines 中运行脚本?

objective-c - 通过所有可用网络接口(interface)使用 GCDAsyncUdpSocket 进行 UDP 广播

Azure 中的 ASP.NET session 状态提供程序

c# - Asp.net MVC 动态 Html 属性

c# - 将自定义 EventArgs 作为事件参数传递

c# - 将设备到云消息从 Azure IoT 中心路由到 Azure Blob 存储

c - 哪个更快 : bitshift vs switch

python - Tornado IOStream.read_until_close 无法正常工作

c# - 如何在保存到磁盘之前压缩文件?