TaJirax/CottenRouter ? reverse-engineered prompt

Reverse engineered prompt

Build me a Go app called CottenRouter that acts like one public gateway for multiple DNS tunnel backends.

I want it to listen on public port 53 and route each incoming DNS request to the right private backend by looking at the first query and matching the longest domain suffix. It should also pass through DoT and HTTPS traffic by reading TLS SNI without terminating TLS, so the traffic stays unchanged. Please include a simple command line tool to validate config, run the router, check health, view status, and manage projects. I also want a guided terminal screen for installing, editing, restarting, detaching, and removing backends, plus a local admin API on loopback only.

Support a JSON config file, examples for local and Docker use, and a Docker setup that can run rootless and read only. Add health checks, timeouts, connection limits, and clear errors when config fields are wrong. If you need to look up any current docs online, go ahead.