Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ring websocket protocol #26

Open
dspiteself opened this issue Sep 24, 2024 · 0 comments
Open

ring websocket protocol #26

dspiteself opened this issue Sep 24, 2024 · 0 comments

Comments

@dspiteself
Copy link

Any interest in me implementing the ring websocket protocol. We could make a ring handler triggered by the upgrade handler. The ring handler would map HttpPrologue and Headers to a ring request and the response would expect a :ring.websocket/listener and optional headers for the upgrade negotiation. This would be more consistent and ergonomic of Clojure users. The trade off it it would require a mutable object implementing WsListener that would wrap and dispatch to :ring.websocket/listener which would be strickly more overhead for the stateless websocket use case. I expect the stateless websockets use case to be rare in the real world . Another benefit is the handler could also be used to reject unauthorized requests by not returning a listener. When a listener is not returned hirundo could throw a WsUpgradeException. One other note is because there is a handler returns a listener could close over state that would also resolve #23

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant