Skip to content

Commit

Permalink
Merge pull request #1426 from zrquan/patch-proxy
Browse files Browse the repository at this point in the history
Forward proxy requests using an absolute URI
  • Loading branch information
shelld3v authored Oct 24, 2024
2 parents 0b27ab7 + 8cd2cb7 commit 2906481
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/connection/requester.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ def __init__(self, proxies: list[str], **kwargs: Any) -> None:
]

async def handle_async_request(self, request: httpx.Request) -> httpx.Response:
request.extensions["target"] = str(request.url).encode()
transport = random.choice(self._transports)
return await transport.handle_async_request(request)

Expand All @@ -300,7 +301,7 @@ def __init__(self) -> None:
}
transport = (
ProxyRoatingTransport(
list(map(self.parse_proxy, options["proxies"])), **tpargs
[self.parse_proxy(p) for p in options["proxies"]], **tpargs
)
if options["proxies"]
else httpx.AsyncHTTPTransport(**tpargs)
Expand Down

0 comments on commit 2906481

Please sign in to comment.