Fabim 2021-02-26T18:08:02.016800Z

@oconn thanks for your answer and the snippet. My current setup is core.async channels for the connections, a http-kit server, chord.http to wrap the websocket handler. I will be switching from compojure to reitit since I need to rework the logic to enable authentication (using buddy). With 3. you mean the server opens a new connection to the client or do you use the incoming one from the client?

Fabim 2021-02-26T19:34:08.017Z

@jakub.zika-extern I guess that means one day I will be using your engine then, ha

oconn 2021-02-26T22:37:08.017200Z

Always use the incoming connection from the client. Because of what I’m using to manage connection pooling, websocket connections make a request to the ws endpoint and if they don’t provide authentication details (in my case this is a short lived token) they get an anonymous connection with limited privileges. If they do provide the token then I associate the connection information with that user. This is probably going to be much different for you (and possibly simpler in some ways) because you’re in control of everything (user pool, http server, authentication libs). You could probably use one secure connection and associate that connection with a user after they have authenticated, or the server has determined that they are authenticated.