-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
aiohttp client does not support ipv6 addresses #559
Comments
looks like through a client with a session, it has to be specified via the connector, which is not intuitive or called out clearly in the documentation imo. |
That makes sense, I see no objections for relaxing default family param from IPv4 to both IPv4 and IPv6. |
TCPConnector processes both IPv4 and IPv6 by default #559
Fixed |
@asvetlov relaxing family breaks (cryptically) on systems with an IPv6 stack, Not sure if pycares should default to IPv4 for |
aiodns is disabled by default by 9fbb7d7 |
For other people wanting to use aiodns, but force IPv4, the solution is to make a custom connector, with import aiohttp
import asyncio
import socket
async def main(loop):
url = 'http://requestb.in/yn6p4wyn'
conn = aiohttp.TCPConnector(family=socket.AF_INET)
async with aiohttp.ClientSession(connector=conn) as session:
async with session.get(url) as resp:
await resp.release()
loop = asyncio.get_event_loop()
loop.run_until_complete(main(loop))
loop.close() I would just point that out, as I think it might be helpfull to some people out there ;) |
attempting to get a webpage from an ipv6 address doesnt appear to work in aiohttp 0.17.4
when i run the ipv6 address through curl it works.
i also tried the ipv4 address through the aiohttp client and that worked as well.
http://[::1]:9001/foo fails with the following exception
**
socket.gaierror: [Errno -9] Address family for hostname not supported
**
The text was updated successfully, but these errors were encountered: