Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get SignalR working with Suave?

Tags:

f#

signalr

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...

like image 326
Aaron Winston Comyn Avatar asked Oct 18 '16 07:10

Aaron Winston Comyn


1 Answers

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

like image 82
Jimmy_Byrd Avatar answered Sep 21 '22 19:09

Jimmy_Byrd