-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add special handling for parsing websocket data #73
Conversation
Hi @sacovo nice job! Though I would handle the websocket case differently. The protocol itself is not trivial to implement: See for example: https://www.rfc-editor.org/rfc/rfc6455#section-5 And it shouldn't go through the http-parser. Instead it should be possible to somehow call |
Sounds reasonable. I'm working on implementing websocket parsing, I'll let you know, as soon as I finish. |
I've implemented a parser here: https://github.com/sacovo/flying_pace/blob/main/flying_pace/websocket.pony |
Sorry for the late reply. I am in the process of adding a behaviour called This way one can manually upgrade to whatever protocol is desired. I want to test this with a websocket library that already exists for pony and use its TCPConnectionNotify implementation: https://github.com/oraoto/pony-websocket/blob/master/websocket/listener.pony#L60 Give me another week to finish the tests, but i think it looks promising. |
Adding the "do not merge" label because this is waiting for the related work from @mfelsche |
Yes, this works (with some small changes). |
Library users can specify when they want to use websocket connections, by setting
allow_upgrade
to true. If so the parser will send received data to the handler, even when nocontent-length
was specified for the request.