Search code examples
f#signalrsuave

How to get SignalR working with Suave?


Does anyone have an example of how to get SignalR working in Suave?

I've created a demo project showing a working Suave server, and working hub proxy generation, along with with a demo page. The page shows a failed initialization and repeated errors attempting to connect to "//ping".

Server configuration:

    let app =
    choose [
             GET >=>
                choose [
                    path "/demo" >=> file (Files.resolvePath __SOURCE_DIRECTORY__ "test.html")
                    OwinApp.ofAppFunc "/" SignalServer.app
                ]
            ]

    startWebServer defaultConfig app

The issue seems to be routing all the signalR 'plumbing' (pings and websockets), appropriately through Suave, but I've had no luck with that so far...


Solution

  • EDIT: Should be fixed via https://github.com/SuaveIO/suave/pull/548


    This seems like a bug in Suave's Owin implementation. You should report it to the repo.

    I do have hack fix, but requires compiling Suave yourself. https://github.com/TheAngryByrd/suave/tree/signalrdemo