reactphp / http

Event-driven, streaming HTTP client and server implementation for ReactPHP.
https://reactphp.org/http/
MIT License
737 stars 142 forks source link

HTTP client: Support HTTP upgrades (WebSockets) #376

Open clue opened 4 years ago

clue commented 4 years ago

This library should provide support for HTTP upgrades (WebSocket etc.) using the Connection: upgrade and Upgrade: websocket headers.

This is already supported on the server-side (see #190), so adding support for this on the client-side should be reasonable. This will likely require a dedicated API as the existing streaming APIs only expose a ReadableStreamInterface and the upgraded stream would have to be a DuplexStreamInterface.

We welcome contributions, reach out if you want to support this project :+1:

bosunski commented 4 years ago

The good news is that I was able to have a working implementation of this during the weekend 😀. I'm currently testing and hope to get a PR in by tomorrow.

mpociot commented 1 month ago

@clue Are there any plans to add this feature? I'd love to add the ability to forward websocket connections to Expose, but those requests currently get closed immediately