Skip to content

Upgrade request to WebSocket #168

Answered by adam-fowler
d-exclaimation asked this question in Q&A
Discussion options

You must be logged in to vote

There is no way to programmatically do it at the moment, but each WebSocket upgrade has a shouldUpgrade closure where you can make a decision on whether the path should upgrade to WebSockets. If you don't want to upgrade you can throw an error. You can control how that error is serialised as an HTTP reponse by conforming it to the HBHTTPErrorResponse protocol. If this isn't enough please add an issue to the websocket repo.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@d-exclaimation
Comment options

Answer selected by d-exclaimation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants