tatut / ripley

Server rendered UIs over WebSockets
MIT License
303 stars 10 forks source link

Support for servers other than http-kit? #16

Closed zekzekus closed 1 year ago

zekzekus commented 1 year ago

I am trying to run ripley in a kit-clj project which uses undertow web server through reitit router. I investigated a lot and found out that the implementation of connection handler is coupled with http-kit server and it's websocket support.

Would you confirm that I am on the right path? I feel I need to implement connection handler for other servers. If it makes sense and might get some help, I would like to try a generic connection handler to integrate with various web servers.

tatut commented 1 year ago

Yes, that is correct. It currently only supports http-kit, as that is what I use for everything.

I would gladly take a PR for a generic one and possibly moving server specific parts to separate impl namespaces.

It would be good to not have direct dependency to a particular serve lib in that case, so we don't need all of them.

zekzekus commented 1 year ago

Good to hear that. How would you look to use https://github.com/taoensso/sente as a dependency here to offload a lot of websocket related details to the library? I am not into too much of websocket details already but with the help of this library I might come up with a generic solution. Just poking for ideas, thanks!

tatut commented 1 year ago

Some implementation could use that, if it helps. I would rather keep the current simple http-kit implementation as is without any new dependencies.

tatut commented 1 year ago

I'll make do some preliminary work for this by moving the particulars of the connection to protocols. Hopefully that will make it easier to implement other servers.

tatut commented 1 year ago

PR #17 is now merged, with example implementation using pedestal+jetty for WebSockets. Hopefully this should make it possible to support undertow as well.

PRs welcome for additional server libraries.