Closed ryfow closed 8 years ago
Ryan, THanks for the report. Unfortunately, I don't use the websockets implementation -it was a vestige from the previous maintainer.
Any patch or PR would be most welcome.
-Chris
I think that the API should only accept a single callback fn to align with most WebSocket clients, i.e. replace :text
and :byte
with :message
. Then it's up to the application to manage the format of the message.
That sounds reasonable.
Upon further investigation, websocket seems to natively handle text and thus byte support calls for additional overhead (some kind of encoding/decoding on each end, plus expansion of messages while in transit). We need to improve this lib's optioning between the two to ensure mutual exclusivity. Thoughts?
When creating a websocket connection, if you specify :byte, :text, :open and :close handlers as the readme describes, :open gets called twice when the websocket is opened and :close gets called twice when the websocket closes.