@@ -222,7 +222,7 @@ class BaseHttpProxy(BaseProxyModel):
222
222
"""
223
223
224
224
@override
225
- async def send_request_to_target ( # pyright: ignore [reportIncompatibleMethodOverride]
225
+ async def send_request_to_target (
226
226
self , * , request : StarletteRequest , target_url : httpx .URL
227
227
) -> StarletteResponse :
228
228
"""Change request headers and send request to target url.
@@ -318,6 +318,8 @@ class ReverseHttpProxy(BaseHttpProxy):
318
318
319
319
# # Examples
320
320
321
+ ## Basic usage
322
+
321
323
```python
322
324
from contextlib import asynccontextmanager
323
325
from typing import AsyncIterator
@@ -341,7 +343,7 @@ async def close_proxy_event(_: FastAPI) -> AsyncIterator[None]: # (1)!
341
343
async def _(request: Request, path: str = ""):
342
344
return await proxy.proxy(request=request, path=path) # (3)!
343
345
344
- # Then run shell: `uvicorn <your.py >:app --host http:// 127.0.0.1:8000 --port 8000`
346
+ # Then run shell: `uvicorn <your_py >:app --host 127.0.0.1 --port 8000`
345
347
# visit the app: `http://127.0.0.1:8000/`
346
348
# you will get the response from `http://www.example.com/`
347
349
```
@@ -452,6 +454,8 @@ class ForwardHttpProxy(BaseHttpProxy):
452
454
453
455
# # Examples
454
456
457
+ ## Basic usage
458
+
455
459
```python
456
460
from contextlib import asynccontextmanager
457
461
from typing import AsyncIterator
@@ -476,7 +480,7 @@ async def close_proxy_event(_: FastAPI) -> AsyncIterator[None]:
476
480
async def _(request: Request, path: str = ""):
477
481
return await proxy.proxy(request=request, path=path)
478
482
479
- # Then run shell: `uvicorn <your.py >:app --host http:// 127.0.0.1:8000 --port 8000`
483
+ # Then run shell: `uvicorn <your_py >:app --host 127.0.0.1 --port 8000`
480
484
# visit the app: `http://127.0.0.1:8000/http://www.example.com`
481
485
# you will get the response from `http://www.example.com`
482
486
```
0 commit comments