locked
SignalR WebSockets on Azure RRS feed

  • Question

  • User-2062007198 posted

    I have a simple SignalR web application on Azure.  The App Service that I setup on Azure has Web Sockets enabled.  My client (Chrome browser) is also has Web Sockets capabilities.  When client (Chrome) and server (Azure) negotiate on the transportation technology.  The server response with "TryWebSockets":false and Server-Sent Event is chosen.

    How can I setup the server so the Web Sockets is supported?

    Wednesday, October 11, 2017 7:05 PM

All replies

  • User1771544211 posted

    Hi anoush,

    This response means that the webSocket is disabled on server side. webSocket also could be disabled in web.config. Please check whether your web configuration file contains following section.

    <system.webServer>
      <webSocket enabled="false"/>
    </system.webServer>

    Updated 5/2/2017

    Since you are using OWIN, please check whether you have added following code to Startup.Configure method to use web sock.

    public void Configure(IApplicationBuilder app)
    {
        app.UseWebSockets();
        app.UseSignalR();
    }

    The above answer is picked from : https://stackoverflow.com/questions/43553504/signalr-not-using-websocket-transport-with-aspnet-4-6

    And note that note all the web browsers support the WebSocket, you can check the supported browsers in the following link.

    https://en.wikipedia.org/wiki/WebSocket

    Best Regards,

    Jean

    Thursday, October 12, 2017 5:43 AM
  • User-2062007198 posted

    Thanks for the info.  This doesn't work.  The reason is our project is .net core (2) application and we had to extend and write our own Owin extension and wrap the SignalR mapping in it.

    However, I have create a dummy SignalR application using the new SignalR for ASP.NET Core 2.0 and on Azure I'm able to communicate with this application by WebSockets protocol ;)

    Wednesday, October 18, 2017 10:25 PM
  • User1771544211 posted

    Hi anoush,

    I thought that you are using ASP.NET.

    However, I have create a dummy SignalR application using the new SignalR for ASP.NET Core 2.0 and on Azure I'm able to communicate with this application by WebSockets protocol ;)

    I'm glad that you have solved your issue and thanks for your sharing.

    Best Regards,

    Jean

    Thursday, October 19, 2017 5:50 AM