Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -134,8 +134,8 @@ async def proxy_to_node(
|
|
134 |
f"Total setup time before streaming: {time.time() - start_time:.4f} seconds"
|
135 |
)
|
136 |
|
137 |
-
req =
|
138 |
-
r = await
|
139 |
print(f"Time to prepare request: {time.time() - start_time:.4f} seconds")
|
140 |
|
141 |
return StreamingResponse(r.aiter_raw(), headers=r.headers)
|
@@ -145,7 +145,7 @@ async def proxy_to_node(
|
|
145 |
"/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]
|
146 |
)
|
147 |
async def catch_all(request: Request, path: str):
|
148 |
-
return await
|
149 |
request,
|
150 |
request.client.host,
|
151 |
4321,
|
|
|
134 |
f"Total setup time before streaming: {time.time() - start_time:.4f} seconds"
|
135 |
)
|
136 |
|
137 |
+
req = client.build_request("GET", httpx.URL(url), headers=headers)
|
138 |
+
r = await client.send(req, stream=True)
|
139 |
print(f"Time to prepare request: {time.time() - start_time:.4f} seconds")
|
140 |
|
141 |
return StreamingResponse(r.aiter_raw(), headers=r.headers)
|
|
|
145 |
"/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"]
|
146 |
)
|
147 |
async def catch_all(request: Request, path: str):
|
148 |
+
return await proxy_to_node(
|
149 |
request,
|
150 |
request.client.host,
|
151 |
4321,
|