SignalR and Fiddler

ASP.NET SignalR is a library that allows a web server to send information to customers in real time. During the development of the application it is sometimes interesting to visualize the exchanges between the server and the customers with a tool such as Fiddler.

Unfortunately after a few exchanges Fiddler does not show much:

Only the initialization of the connection is visible. The following exchanges are via Web Socket and are not intercepted by Fiddler.

Therefore, disable Web Socket support for SignalR to use HTTP. Fiddler is thus able to intercept the exchanges between the server and the client are visible:

public void Configuration(IAppBuilder app)
{
    var transportManager = GlobalHost.DependencyResolver.Resolve<ITransportManager>() as TransportManager;
    if (transportManager != null)
    {
        transportManager.Remove("webSockets");
    }

    HubConfiguration hubConfiguration = new HubConfiguration();
    app.MapSignalR(hubConfiguration);
}

And here's the result :

Leave a reply