duct-framework / duct

Server-side application framework for Clojure
MIT License
1.13k stars 51 forks source link

Websockets #101

Closed 0x4d6165 closed 4 years ago

0x4d6165 commented 4 years ago

Does this project support websockets (either only through jetty or through other servers as well)? If not, could support be added?

weavejester commented 4 years ago

Yes, there's a library for Aleph and HTTP-Kit, both of which have websocket support.

0x4d6165 commented 4 years ago

Awesome! Could you provide an example with aleph? I'm not sure where to throw the (aleph/websocket-connection req) function

weavejester commented 4 years ago

If you create a new Duct project with:

lein new duct foo +web +example

Or:

lein new duct foo +web +example +ataraxy

Then you'll see an example of how to fit a handler into a Duct project. The actual specifics of how to get the websocket vary between the different adapters, so you'll need to consult their documentation.