You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Connection#dispatch relies on raw http input. When using this in an environment where the raw http input is already parsed (and thus not easily available) (think vanilla rack/thin app), things become complicated.
My solution:
i created a class WebSocketParserData, which allows for the #match used in Connection#dispatch
I monkey patched Handshake to include a #receive_data that does no parsing
I wrote my own Connection class (which inherits from your connection) and call the standard #dispatch with the already parsed data.
Is there a simpler way? If no, consider adding functionality to Connection#dispatch that detects difference between raw data, and pre-parsed data (as i did through the introduction of WebSocketParserData) and add a Handshake#receive_parsed_data in this case.
The text was updated successfully, but these errors were encountered:
I agree it would be nice if the code was abstracted such that running behind e.g. rack was easy and a documented API. I may give this a go at some point, but meanwhile if you can see a clean way of doing this I'm very open to a pull request :)
Currently Connection#dispatch relies on raw http input. When using this in an environment where the raw http input is already parsed (and thus not easily available) (think vanilla rack/thin app), things become complicated.
My solution:
Is there a simpler way? If no, consider adding functionality to Connection#dispatch that detects difference between raw data, and pre-parsed data (as i did through the introduction of WebSocketParserData) and add a Handshake#receive_parsed_data in this case.
The text was updated successfully, but these errors were encountered: