Skip to content

bpo-24209: Adds IPv6 support when invoking http.server directly.#10595

Merged
lisroach merged 1 commit into
python:masterfrom
lisroach:issue_24209
Nov 26, 2018
Merged

bpo-24209: Adds IPv6 support when invoking http.server directly.#10595
lisroach merged 1 commit into
python:masterfrom
lisroach:issue_24209

Conversation

@lisroach

@lisroach lisroach commented Nov 19, 2018

Copy link
Copy Markdown
Contributor

@gpshead gpshead left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. I'll let you do the merge.

@lisroach
lisroach merged commit 433433f into python:master Nov 26, 2018
@lisroach
lisroach deleted the issue_24209 branch November 26, 2018 18:43

@jaraco jaraco left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for taking this on and effecting the change. I apologize for being so late in review. This change is an excellent first approach, taking on the unit test as well.

I'll take on the responsibility to follow up on the above concerns, whether that's to address them directly or file tickets.

Comment thread Lib/http/server.py
"""
server_address = (bind, port)

if ':' in bind:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although : is sufficient to indicate that the family should be INET6, it's not necessary. For example, one could specify localhost, which may resolve to 127.0.0.1 or ::1 or both. Or one may bind to '' or None, which will resolve to all interfaces. In that case, INET6 or AF_UNSPEC might be more appropriate.

Plus, I'd prefer that the default behavior should be to bind to IPv6, which in many cases also supports binding to IPv4 (at least for ::, all interfaces), and only fall back to the older IPv4 standard when necessary or directed. I do say though, with as few people familiar with IPv6, it's probably a hard sell to make it the default, even if that's eventually where the code should end up and it's been more than a decade in the transition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants