Skip to content

Resolve port by name #7

@vshymanskyy

Description

@vshymanskyy

According to the docs, the 2nd getaddrinfo argument (servname) is either a decimal port number or a service name listed in /etc/services.
We could add a reduced service name database like this:

services = {
    "telnet": 23,
    "tftp": 69,
    "ntp": 123,
    "http": 80,
    "https": 443,
    "mqtt": 1883,
    "mqtts": 8883,
}

It could easily be extended by the developer if needed:

aiodns.services.update({"ftp": 21, "ssh": 22})

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions