Search code examples
asp.netiiswebsocketsignalrsignalr.client

SignalR Client returns HTTP error 400 Bad request when websocket is used


I am using a SignalR Client connection using HubConnection. When calling Start(), an System.Net.WebException is thrown with the following message:

The remote server returned an error: (400) Bad Request.

The server response is:

Not a valid web socket request.

I am running Windows Server 2012 R2 with IIS 8.5

What could be the problem?


Solution

  • The problem was with the configuration of IIS.

    You have to install the WebSocket Protocol support in order to connect to SignalR using WebSockets.

    enter image description here