pohjavirta icon indicating copy to clipboard operation
pohjavirta copied to clipboard

Support Websockets

Open ikitommi opened this issue 5 years ago • 1 comments

ikitommi avatar Jul 09 '19 20:07 ikitommi

Here's a starting point: https://github.com/plexus/procflow/blob/master/src/procflow/http/websocket.clj

It assumes you're using reitit like this

["/ws" {:websocket {:on-connect procflow.http/on-connect
                                                     :on-receive procflow.http/on-receive
                                                     :on-close   procflow.http/on-close
                                                     :on-error   procflow.http/on-error}}]

Not optimized at all, probably still has serious bugs, and contains some obvious inefficiencies (e.g. it will match all non-websocket routes twice), but like I said it's a starting point.

plexus avatar Oct 31 '19 10:10 plexus