Starlette: Proxy

Created on 29 Nov 2018  路  5Comments  路  Source: encode/starlette

I'm trying to use an ASGI app as a proxy as explained here. However, is might require something like wsgiprox but for ASGI. Could there be proxy support on starlette?

feature

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.

All 5 comments

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

Was this page helpful?
0 / 5 - 0 ratings