TUN-7021: Fix proxy-dns not starting when cloudflared tunnel is run

This PR starts a separate server for proxy-dns if the configuration is
available. This fixes a problem on cloudflared not starting in proxy-dns
mode if the url flag (which isn't necessary for proxy-dns) is not
provided. Note: This is still being supported for legacy reasons and
since proxy-dns is not a tunnel and should not be part of the
cloudflared tunnel group of commands.
This commit is contained in:
Sudarsan Reddy 2022-12-20 11:26:27 +00:00
parent 045439f0ab
commit d19da6767a
1 changed files with 7 additions and 0 deletions

View File

@ -195,6 +195,13 @@ func TunnelCommand(c *cli.Context) error {
return runClassicTunnel(sc) return runClassicTunnel(sc)
} }
if c.String("proxy-dns") != "" {
// NamedTunnelProperties are nil since proxy dns server does not need it.
// This is supported for legacy reasons: dns proxy server is not a tunnel and ideally should
// not run as part of cloudflared tunnel.
return StartServer(sc.c, buildInfo, nil, sc.log)
}
return errors.New(tunnelCmdErrorMessage) return errors.New(tunnelCmdErrorMessage)
} }