-
Hi.
Does aiohttp has Anyway to bind specific network interface to bind specific network interface? |
Beta Was this translation helpful? Give feedback.
Answered by
webknjaz
Feb 27, 2021
Replies: 1 comment 4 replies
-
I believe you should be able to specify a custom import aiohttp
local_address = `localhost`, 12345
tcp_connector = aiohttp.TCPConnector(local_addr=local_address)
async with aiohttp.ClientSession(connector=tcp_connector) as http_session:
async with http_session.get("https://google.com") as http_response:
print(await http_response.text()) |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
webknjaz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe you should be able to specify a custom
TCPConnector
instance with alocal_addr
set. For example: