cloudflare / cloudflare/cloudflared

cloudflared doesn't provide useful diagnostics for proxy loops

Open
#490 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.6k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

A common pattern for scripts that use tunnels is to start the tunnel in the background, export an environment variable configuring the use of that tunnel, running the wrapped command, and then killing the backgrounded tunnel when it's done.

This works pretty well, but if for whatever reason that environment variable gets set first, and it's one that cloudflared itself honors, such as HTTPS_PROXY, it will form a proxy loop and recursively open proxy sessions to itself until it runs out of file descriptors, leaving the user extremely baffled that a program that should only be opening 2 sockets is running out of those. While this is a case of the user asking cloudflared to do something ridiculous, it's a somewhat easy mistake to make, and there's no hint of what it's doing in any place one normally looks to troubleshoot resource exhaustion.

While there are certainly difficult edge cases, it would be easy to detect the more obvious proxy loops (like this one) and emit a warning when it appears that the user has asked cloudflared to do something that is expected to cause cloudflared to exit abnormally.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.