Haproxy listener based on domain

I want to run all my servers to listen on port 25565, but I can do that since I can’t have multiple listeners on the same port. I was wondering if there was a way to point
subdomain1.example.com > listener1:25565
subdomain2.example.com > listener2:25565
subdomain3.example.com > listener3:25565
and have people cname their domain to subdomain1.example.com to connect to listener1, cname their domain to subdomain2 to connect to listener listener2 and so on.
I have seen some services where you use cname to their domain and you can connect via 25565 instead of a randomized port although I’m not sure if they are using haproxy.