-
Notifications
You must be signed in to change notification settings - Fork 187
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
Offer a direct migration from faye-websockets #87
Comments
Sam, what you've described is pretty much exactly what we did in Goliath to provide websocket support: As long as you have access to the underlying EM connection object, you should be able to pretty much translate that code to work with thin as well. You just have to map the right Thin callbacks.. |
I started writing an adapter, a big issue is that https://github.com/igrigorik/em-websocket/blob/master/lib/em-websocket/connection.rb is not reusable so I need to copy and paste wholesale, perhaps it should be moved to a module? |
Another painful issue seems to be the heavy reliance on httpparser.rb I need to do a bit of magic code converting rack request to httpparser ones |
Not sure how you're structuring your code, but notice that the Goliath code did not have to copy the connection class - we simply implemented the necessary shims and mapped to http_parser.rb.. which is what Goliath uses (no dependencies to em-websocket). |
yeah, I follow, my thin implementation takes a slightly different approach. I got it going though the secure stuff is not working yet, https://github.com/SamSaffron/thin-em-websocket/blob/master/examples/config.ru will publish the gem once it is a bit more battle tested |
This is part feature request, part documentation request.
I am using https://github.com/faye/faye-websocket-ruby in my current project, mainly cause it offers a simple integration point with Rack and Thin.
To get it going it monkey patches Thin so essentially the EM connection is exposed.
I would much prefer to use em-websockets, since
however
Thoughts?
The text was updated successfully, but these errors were encountered: