Yup, we'll certainly add a proxy component at some point.
You can take a look at https://github.com/encode/starlette/pull/24/files if you want a starting point on that.
I'm also interested in this
Here's an example of an ASGI proxy app, that you could mount within Starlette... https://gist.github.com/tomchristie/5765e10a90a41c7e57470e2dc700f9db
Just found this issue after being pointed to the gist. The implementation there seems to work great for http requests but I'm struggling to adapt it to also work for websockets.
Anyway, it's very useful functionality as-is so it would be great to have this in starlette itself. :+1:
There is an implementation over at valohai/asgiproxy but I'm actually using trio so can't use that directly.
Since the implementation here uses httpx which works with trio I can actually use that which is great! :heart:
For the websocket part I think I might have to cobble something together with trio-websocket
Most helpful comment
Yup, we'll certainly add a proxy component at some point.
You can take a look at https://github.com/encode/starlette/pull/24/files if you want a starting point on that.