Skip to content
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

http.server (command) fails to bind dual-stack on Windows #83088

Closed
zkonge mannequin opened this issue Nov 24, 2019 · 8 comments
Closed

http.server (command) fails to bind dual-stack on Windows #83088

zkonge mannequin opened this issue Nov 24, 2019 · 8 comments
Labels
3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@zkonge
Copy link
Mannequin

zkonge mannequin commented Nov 24, 2019

BPO 38907
Nosy @jaraco, @zkonge
PRs
  • bpo-38907: Add IPv6 Dual-Stack control for http.server #17378
  • bpo-38907: In http.server script, restore binding to IPv4 on Windows. #17851
  • [3.8] bpo-38907: In http.server script, restore binding to IPv4 on Windows. (GH-17851) #17854
  • bpo-38907: Suppress any exception when attempting to set V6ONLY. #17864
  • [3.8] bpo-38907: Suppress any exception when attempting to set V6ONLY. (GH-17864) #17865
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-01-06.13:30:04.604>
    created_at = <Date 2019-11-24.17:04:10.875>
    labels = ['3.8', 'type-feature', 'library', '3.9']
    title = 'http.server (command) fails to bind dual-stack on Windows'
    updated_at = <Date 2020-01-06.13:30:04.603>
    user = 'https://github.com/zkonge'

    bugs.python.org fields:

    activity = <Date 2020-01-06.13:30:04.603>
    actor = 'jaraco'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-01-06.13:30:04.604>
    closer = 'jaraco'
    components = ['Library (Lib)']
    creation = <Date 2019-11-24.17:04:10.875>
    creator = 'zkonge'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38907
    keywords = ['patch']
    message_count = 8.0
    messages = ['357399', '357401', '359378', '359399', '359419', '359422', '359424', '359425']
    nosy_count = 2.0
    nosy_names = ['jaraco', 'zkonge']
    pr_nums = ['17378', '17851', '17854', '17864', '17865']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue38907'
    versions = ['Python 3.8', 'Python 3.9']

    @zkonge
    Copy link
    Mannequin Author

    zkonge mannequin commented Nov 24, 2019

    In Python 3.8+, when we run the http.server in a PC that support IPv6, it will bind IPv6 socket normally. On Linux or some other platforms, it also bind IPv4, that's pretty good, but on Windows, it doesn't work and "--bind 0.0.0.0" have to be provided to make it works in IPv4 environment.
    In another case, once someone only want the http.server provide service in IPv6 environment, but linux will still bind IPv4 socket automatically.

    Could we add a argument such as "--ipv6-only" for http.server and open the support of Dual-Stack socket by default?

    @zkonge zkonge mannequin added 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Nov 24, 2019
    @zkonge
    Copy link
    Mannequin Author

    zkonge mannequin commented Nov 24, 2019

    "--no-dual-stack" seems to be a better argument name. "--ipv6-only" lead to ambiguity in a IPv4 only environment.

    @jaraco
    Copy link
    Member

    jaraco commented Jan 5, 2020

    In bpo-39211, I've done a good deal of investigation on this issue and confirmed your findings - on Windows, the server fails to bind dual stack on Windows, but instead binds IPV6ONLY. That needs to be fixed such that the default is to bind dual-stack. Adding dual-stack control is a new feature and should be considered separately.

    @jaraco jaraco changed the title Add IPv6 Dual-Stack control for http.server http.server (command) fails to bind dual-stack on Windows Jan 5, 2020
    @jaraco
    Copy link
    Member

    jaraco commented Jan 6, 2020

    New changeset ee94bdb by Jason R. Coombs in branch 'master':
    bpo-38907: In http.server script, restore binding to IPv4 on Windows. (GH-17851)
    ee94bdb

    @jaraco
    Copy link
    Member

    jaraco commented Jan 6, 2020

    New changeset 5ed9d60 by Jason R. Coombs (Miss Islington (bot)) in branch '3.8':
    bpo-38907: In http.server script, restore binding to IPv4 on Windows. (GH-17851) (bpo-17854)
    5ed9d60

    @jaraco
    Copy link
    Member

    jaraco commented Jan 6, 2020

    New changeset 7cdc31a by Jason R. Coombs in branch 'master':
    bpo-38907: Suppress any exception when attempting to set V6ONLY. (GH-17864)
    7cdc31a

    @jaraco
    Copy link
    Member

    jaraco commented Jan 6, 2020

    New changeset 33cb4a6 by Jason R. Coombs (Miss Islington (bot)) in branch '3.8':
    bpo-38907: Suppress any exception when attempting to set V6ONLY. (GH-17864) (GH-17865)
    33cb4a6

    @jaraco
    Copy link
    Member

    jaraco commented Jan 6, 2020

    In PR 17378, we discussed and I believe the conclusion is that the fix in the other PR(s) is sufficient to address the deficiency.

    @jaraco jaraco closed this as completed Jan 6, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant