Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 191
Local address support#134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
0faa59a4b41aaa731dcf8a2faecb96cb8088fdc117cc4963e9cd0dee6285d29abb518f36acad7e634023379080529070ad04be66b91f4104e55fb6e9d9def2440df2c195bd959ee5c3919b3fe3699a948c0ba6b9File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -212,6 +212,24 @@ async def test_http_proxy(proxy_server: URL, proxy_mode: str) -> None: | ||
| assert reason == b"OK" | ||
| @pytest.mark.asyncio | ||
| # This doesn't run with trio, since trio doesn't support local_address. | ||
| async def test_http_request_local_address() -> None: | ||
| async with httpcore.AsyncConnectionPool(local_address="0.0.0.0") as http: | ||
| method = b"GET" | ||
| url = (b"http", b"example.org", 80, b"/") | ||
| headers = [(b"host", b"example.org")] | ||
| http_version, status_code, reason, headers, stream = await http.request( | ||
| method, url, headers | ||
| ) | ||
| body = await read_body(stream) | ||
| assert http_version == b"HTTP/1.1" | ||
| assert status_code == 200 | ||
| assert reason == b"OK" | ||
| assert len(http._connections[url[:3]]) == 1 # type: ignore | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't look like this test tests that the | ||
| # mitmproxy does not support forwarding HTTPS requests | ||
| @pytest.mark.parametrize("proxy_mode", ["DEFAULT", "TUNNEL_ONLY"]) | ||
| @pytest.mark.usefixtures("async_environment") | ||
Uh oh!
There was an error while loading. Please reload this page.