Skip to content
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

Upgrade to async-websocket >= 0.9 #282

Open
dblock opened this issue Jul 20, 2019 · 2 comments
Open

Upgrade to async-websocket >= 0.9 #282

dblock opened this issue Jul 20, 2019 · 2 comments
Labels

Comments

@dblock
Copy link
Collaborator

dblock commented Jul 20, 2019

The interface has changed, looks like there's a native ws implementation, etc.

cc: @ioquatix I started on this but couldn't make it work

Correct set of includes to start for async.rb

require 'async'
require 'async/websocket'
require 'async/io/ssl_endpoint'
require 'async/notification'
require 'async/clock'
@dblock
Copy link
Collaborator Author

dblock commented Jul 20, 2019

Locked down at runtime in #283

@ioquatix
Copy link
Contributor

We have protocol-websocket which is about 4x more memory efficient which was the main driver for the implementation, and it also supports websockets over HTTP/1 and HTTP/2.

You'll need to subclass the Connection class and handle the incoming frames.

The previous implementation depended on faye-websocket event emitter and object types, so you'll need to make some kind of wrapper if you want to have the same interface there.

However, practically speaking, there isn't that much to wrap - it's mostly just text and data frames. Some of the frames emitted by faye don't correspond to actual websocket frames which is probably confusing in hindsight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants