cloudflare/pingora

ProxyHttp and websocket proxy

Closed this issue · 1 comments

I'm trying to use ProxyHttp to handle websocket upgrade requests, then let fastwebsockets to take the underlying Stream and take over websocket traffic. I'm having a hard time figuring out how to own that Stream. ProxyHttp provides a mut ref to Session and how is it possible to take the ownership of the Stream in my code? I'm aware of into_inner in HttpSession (session.downstream_session), but I can't move it with only a ref to Session.

Please suggest. Thanks.

@pippoflow would you be able to elaborate on how you resolved this? I want to track when a websocket starts and when the connection ends. Right now pingora doesn’t have any clear way to track this