-
Notifications
You must be signed in to change notification settings - Fork 87
Conversation
@halorgium if you feel like jumping on this, please go ahead. You might get to it before me and will know better than I would. As mentioned in IRC, I am not going to use Rack's hijack support in my own applications. I am seeing I need to regain some ground. It will likely take me several days to get back to this. |
@digitalextremist sure. i hope you learnt some things while giving this a go! |
@@ -139,7 +139,7 @@ def respond(response, headers_or_body = {}, body = nil) | |||
# The client disconnected early | |||
@keepalive = false | |||
ensure | |||
if @keepalive | |||
if @keepalive || body.nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tarcieri needs a more sane approach for telling the Connection
to not close the socket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@halorgium Connection#detach
, see: https://github.com/celluloid/reel/blob/master/lib/reel/connection.rb#L36
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, all Connection
s are detached with the Rack
handler. see:
Line 44 in a273967
Celluloid::Actor[:reel_rack_pool].handle(connection.detach) |
@halorgium nice work! Using your branch, I am able to verify full Rack-WebSocket compatibility using the pre-header hijack approach. Once the socket is taken over by my application, I complete the handshake myself and have a full-duplex connection ( which works very nicely with faye/websocket-protocol-ruby ) |
As mentioned, I am using your branch in my development environment -- At times it seems requests for static files are not closing. Trying to isolate // |
@digitalextremist probably best to file a new issue, but static files should not be hijacked... are you using a middleware like EDIT: should not |
No middleware that might affect static files. Brought this up here because it might also extend to ordinary Requests not coming in through ws:// ...I've been seeing it enough to where I thought you might want to surf around in your branch in a browser that loads images, css, js, etc. |
@halorgium closing this for now. I'm changing the internal hijacking API in #77. I think we need to redo the Rack adapter completely before we consider supporting Rack's hijack |
Rack now supports a "hijack" API which allows high-level frameworks built on top of Rack (e.g. Rails) to access the underlying socket:
rack/rack#481
It would be great if Reel supported this feature, as it would expose its end-to-end streaming support (along with Celluloid::IO-based sockets) to frameworks wishing to utilize the hijack API.