Skip to content

DNS SRV support #2003

Open
Open
@spacekitteh

Description

@spacekitteh

I've looked through the code and I can't find anything suggesting that MQTT.js supports lookup by SRV records.

There are four SRV combinations listed by IANA for MQTT, {mqtt, secure-mqtt} × {tcp, udp}.

If it doesn't, it should, given a server hostname example.com, first look for _secure-mqtt._tcp.example.com, followed by _secure-mqtt._udp.example.com, and if one of those is found, connect as if a URI had been given with a mqtts scheme. Only if neither of those exist, should it look for the mqtt versions (and only if allowed by an option, which if disabled (by default) would prevent fallback to insecure communication).

Additional context
Given #2002, now might be a good time to implement this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions