Closed u3shit closed 2 years ago
I believe Rack 3.0 will fix this problem, but let me investigate.
We have merged the streaming proposal so Rack 3 will work correctly, even from within Rails, but it will take some time for this change to work it's way through the eco-system.
I'm trying to create a websocket server in a Rack application, unfortunately it looks like any middleware that uses
BodyProxy
(for exampleCommonLogger
orLint
) break the websocket support.Trying to connect to this server results in:
This does not happen if I remove the
app = Rack::CommonLogger.new app
line.Falcon::Adapter::Output
does a@body.to_enum(:each)
which creates a Fiber internally, but it won't be an async fiber, hence the error. (WithoutBodyProxy
, falcon can somehow figure out the response is a Hijack and it doesn't even create anOutput
from what can I tell.) Any idea what to do with this? (I'm trying to port an app using EventMachine+thin+faye-websocket, there this configuration worked without problems.) P.s. the rack server example doesn't seem to work for me, it throws anundefined method `run' for main:Object
error in an infinite loop for me.