cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
20.25k stars 1.1k forks source link

Support DNS Discover #222

Open Benjmmi opened 2 months ago

Benjmmi commented 2 months ago

I noticed a TODO item in the code for DNS service discovery, and I've made some progress on it. It's still a work in progress. However, I'm also wondering if it's necessary to return the port based on the protocol dns.rs

eaufavor commented 2 months ago

Thanks for looking into this TODO.

There are many ways to do DNS based discovery. Beside using the A/AAAA record directly, which doesn't carry any information about ports, others use SRV and TXT DNS record which can carry port information.

Another thing is that our service discovery traits are public. You can use and share your implementation of DNS service discovery (as a "plugin") with 3rd party without contributing to our code base.