Why SignalR does isn't use WebSockets?

Source: Internet
Author: User

Why SignalR does isn't use WebSockets?

As you probably know SignalR supports multiple transports. The favor one and most powerful one is of course WEBSOCKET transport.
Unfortunately this transport cannot is always used in any infrastructure. When your application is started the client side of SignalR would check what's transports is supported.
Interestingly there is a similar check at the server side.

For example, if you see following request

Post/daenet.myspy/signalr/signalr/send?transport=foreverframe&connectionid= cd17bb01-23de-4181-97da-6514b9bbb58e http/1.1

Which is responded by following response, it means the web socket transport is not supported. IF infrastructure does not the support streaming SIgnalR would use fallback transport. In a case of Internet Explorer this would be foreverframe as shown above.
To being sure that the server was not the problem, try-to-find out the request like following one:

Get/daenet.myspy/signalr/signalr/connect?transport=websockets&connectionid= Cd17bb01-23de-4181-97da-6514b9bbb58e&connectiondata=%5b%7b%22name%22%3a%22trackerhub%22%7d%5d&tid=6 http/1.1

If This request has a failed with error, it means that the server does is not a support websockets. Specific case server means the server (IIS) supports WebSockets, but ASP. Your application which hos TS SignalR does not the support websockets.
It sound Wired, buiit are not. If the server does not support WebSockets (for example Windows server), you'll never get error. The client would switch to fallback transport automatically. This error was related to ASP.
To fix it your need following in the Web. config:

<system.web>

<compilation debug= "true" targetframework= "4.5"/>

<pages controlrenderingcompatibilityversion= "4.0"/>
</system.web>

Http://localhost/MySpy/signalr/signalr/connect?transport=webSockets&connectionId= 829cc336-a32c-457a-b539-fca7744fda09&connectiondata=%5b%7b%22name%22%3a%22trackerhub%22%7d%5d&tid=7

Why SignalR does isn't use WebSockets?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.