Created
April 6, 2021 10:39
-
-
Save linw1995/4d3bb8741382ae37988d458f0a538a38 to your computer and use it in GitHub Desktop.
aiohttp integrates with mitmproxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ssl | |
| import asyncio | |
| from aiohttp import ClientSession | |
| async def main(): | |
| async with ClientSession() as session: | |
| sslcontext = ssl.create_default_context(cafile='~/.mitmproxy/mitmproxy-ca.pem') | |
| r = await session.get('https://example.com', proxy='http://localhost:8080', ssl=sslcontext) | |
| r.raise_for_status() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment