简体   繁体   English

Azure上的SignalR:连接握手失败

[英]SignalR on Azure: Failed Connection Handshake

I am getting an error in my application whereby the connection over wss:// is failing. 我的应用程序中出现错误,因此通过wss://的连接失败。

The browser gets a 200 status code, and I see the log line in ASP.NET Core app that looks like: 浏览器获得200状态代码,我在ASP.NET Core应用中看到如下日志行:

{"@t":"2019-09-06T16:46:58.0850696Z","@m":"Failed connection handshake.","@i":"ebdbcf97","@l":"Error","EventId":{"Id":5,"Name":"HandshakeFailed"},"SourceContext":"Microsoft.AspNetCore.SignalR.HubConnectionContext","TransportConnectionId":"qLt39WTMAY4t-Q4vyRTGrg","RequestId":"0HLPISG9A2QAE:00000006","RequestPath":"/hubs/results","CorrelationId":null,"ConnectionId":"0HLPISG9A2QAE"} {“ @t”:“ 2019-09-06T16:46:58.0850696Z”,“ @ m”:“连接握手失败。”,“ @ i”:“ ebdbcf97”,“ @ l”:“错误”,“ EventId“:{” Id“:5,” Name“:” HandshakeFailed“},” SourceContext“:” Microsoft.AspNetCore.SignalR.HubConnectionContext“,” TransportConnectionId“:” qLt39WTMAY4t-Q4vyRTGrg“,” RequestId“:” 0HLPISG9A2QAE: 00000006“,” RequestPath“:” /集线器/结果“,” CorrelationId“:null,” ConnectionId“:” 0HLPISG9A2QAE“}

Browser error: 浏览器错误:

WebSocket connection to 'wss://frontend.env.company.com/hubs/results?id=qLt39WTMAY4t-Q4vyRTGrg' failed: Error during WebSocket handshake: Unexpected response code: 200 WebSocket与'wss://frontend.env.company.com/hubs/results?id = qLt39WTMAY4t-Q4vyRTGrg'的连接失败:WebSocket握手期间出错:意外的响应代码:200

The application is running behind an nginx in a kubernetes cluster hosted on Azure. 该应用程序在Azure托管的kubernetes群集中的nginx后面运行。 It's fronted by Azure CDN which routes certain /paths to this origin/endpoint. 它以Azure CDN开头,它将某些/ path路由到此起点/端点。

Any help would be appreciated. 任何帮助,将不胜感激。

Thanks! 谢谢!

The explanation is that Azure CDN with Premium Verizon does not support WebSockets. 原因是带有Premium Verizon的Azure CDN不支持WebSockets。 Have moved away from that as a solution and used nginx instead, which works beautifully. 已经不再使用它作为解决方案,而是使用了nginx,效果很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM