-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Expose NetworkStream+Send to the server #521
Comments
The changes to do here is to change the |
Alternatively just add downcasting to |
Ah yes, we could duplicate the definition for |
I'm going to attempt to make the changes myself using the first proposed solution. If I get stuck I'll post on this thread. When I'm ready I'll make a PR |
The second one would be easier. The first would be preferred if there's a need to send that trait object to another thread... |
Wouldn't that be useful? For instance, I initialize a websocket connection. Later on, my client makes an http request and that request wants to be able to send data through the websocket while the new request is still processing. I'm just not sure if this scenario would require passing NetworkStream+Send to more than one thread(my intuition tells me it would). In any case I will attempt both |
I need access to the downcast methods on NetworkStream+Send on the server in order to gain access to a TcpStream object. This will allow me to implement an iron middleware to upgrade connections to websocket connections, following the work already done in rust-websockets.
Iron currently only has access to a NetworkStream which is obtained by calling "deconstruct" on the request object provided by hyper.
The text was updated successfully, but these errors were encountered: