Skip to content

start_http_server dual stack and IPv6 literals #791

@baryluk

Description

@baryluk

Version 0.13.1

Python 3.9.11 on Debian testing.

I saw #567 , but this is still broken.

prometheus_client.start_http_server(port=9888, addr="localhost") - only listens on IPv4

prometheus_client.start_http_server(port=9888, addr="::") - doesn't work

prometheus_client.start_http_server(port=9888, addr="::1") - doesn't work

prometheus_client.start_http_server(port=9888, addr="[::]") - doesn't work

Optimally, it should be configurable using a single parameter, because it is easier to pass things from command line using a single parameter, than parsing it manually in every program that requires it:

--listen=:9888 for example, to listen on 0.0.0.0 and ::.
--listen=localhost:9888 for example, to listen on 127.0.0.1 and ::1.
--listen=[::1]:9888 for example, to listen on ::1.
--listen=127.0.0.1:9888 for example, to listen on 127.0.0.1.

Ability to bind to interface would also be nice. (i.e. --listen=10.0.0.1:9888@eth1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions