socketry / async-websocket

Asynchronous WebSocket client and server, supporting HTTP/1 and HTTP/2 for Ruby.
MIT License
166 stars 18 forks source link

Maybe JSON is redundant... #23

Closed nikoloss closed 4 years ago

nikoloss commented 4 years ago

https://github.com/socketry/async-websocket/blob/ede7d23a56fbb2f351a99e313bca0eb8f5cbc80c/lib/async/websocket/connection.rb#L63 Sorry for disturbing u, I'm using websocket for something like remote desktop, bin data transmission. Due to the jsonified data I have to decode them in addition. I think json here is a little redundant, raw message is suitable I can apply my own protocols or codecs

ioquatix commented 4 years ago

You can access the raw protocol by making your own connection class.

ioquatix commented 4 years ago

Make a subclass of Protocol::WebSocket::Connection (or use it if you just want raw data).

https://github.com/socketry/async-websocket/blob/master/lib/async/websocket/connection.rb#L63-L79

ioquatix commented 4 years ago

https://github.com/socketry/async-websocket/issues/20