简体   繁体   English

无法托管WebSocket服务器-握手期间出错

[英]Cannot host WebSocket Server - error during handshake

I want to try a WebSockets and I found this artcile on the internet Using WebSocket in .NET I am sure that I did every step properly, I enabled WebSockets in IIS, I wrote all clases which are mention in article, I register HTTP Handler in web.config etc.. but when I want to try it I still get exception: 我想尝试一个WebSockets,然后在Internet上找到了这个技巧。 在.NET中使用WebSocket,我确信我已经正确地完成了每个步骤,在IIS中启用了WebSockets,我写了文章中提到的所有小节,并在其中注册了HTTP Handler。 web.config等。但是当我想尝试时,仍然出现异常:

WebSocket connection to 'ws://localhost/CodeProjectWeb/WSHandler.ashx' failed: Error during WebSocket handshake: Unexpected response code: 404 WebSocket与'ws://localhost/CodeProjectWeb/WSHandler.ashx'的连接失败:WebSocket握手期间出错:意外的响应代码:404

I know that 404 probably means that URL is wrong, but how can be wrong? 我知道404可能意味着URL错误,但是怎么可能是错误的呢? Some additional info: I am running on windows 10, IIS 10.0 Express, .NET 4.6, Visual Studio 2013, I tried it on Google Chrome, Firefox (both last versions). 一些其他信息:我在Windows 10,IIS 10.0 Express,.NET 4.6,Visual Studio 2013上运行,我在Google Chrome,Firefox(均为最新版本)上进行了尝试。 To be honest, this is not first tutorial which I tried. 老实说,这不是我尝试的第一个教程。 I already tried antoher 3-4 articles about WebSocket in .NET, also I tried use SignalR but still with the same results. 我已经在.NET中尝试了3-4篇有关WebSocket的文章,也尝试过使用SignalR,但结果仍然相同。 I just dont know, I think that I am missing some important little thing.. 我只是不知道,我想我错过了一些重要的小事情。

If you need some more information just ask but I hope I write everything 如果您需要更多信息,请询问,但我希望我能写一切

I finally figure it out (probably). 我终于弄清楚了(可能)。 I have to turn off Windows Firewall to make it work. 我必须关闭Windows防火墙才能使其正常运行。 So if you have similar problem just be sure that your Firewall is turn off. 因此,如果您遇到类似的问题,请确保已关闭防火墙。

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

相关问题 chrome在WebSocket握手期间获取新错误 - chrome getting new Error during WebSocket handshake WebSocket 连接失败。 WebSocket 握手期间出错 - socketjs - WebSocket connection failed. Error during WebSocket handshake - socketjs Websocket:WebSocket握手期间出错:意外的响应代码:504 - Websocket : Error during WebSocket handshake: Unexpected response code: 504 Websocket - WebSocket 握手期间出错:意外的响应代码:404 - Websocket - Error during WebSocket handshake: Unexpected response code: 404 尝试连接到服务器时..失败:WebSocket 握手期间出错:意外响应代码:404 - when trying connecting to server.. failed: Error during WebSocket handshake: Unexpected response code: 404 javascript-WebSocket握手期间错误:意外的响应代码:404 - javascript - Error during WebSocket handshake: Unexpected response code: 404 Websocket握手代码期间无法连接signalR错误:400 - failed to connect signalR error during websocket handshake code : 400 Sailsjs:WebSocket握手期间出错:意外的响应代码:400 - Sailsjs: Error during WebSocket handshake: Unexpected response code: 400 WebSocket 握手期间出错:意外的响应代码:500 - Error during WebSocket handshake: Unexpected response code: 500 SignalR-WebSocket握手期间错误:意外的响应代码:504 - SignalR - Error during WebSocket handshake: Unexpected response code: 504
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM