logcli: add --proxy-url flag for http/https proxy support #6484
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
--proxy-url
flag tologcli
to support connecting to Loki instances running behind either HTTP or HTTPS CONNECT-style proxies.Examples:
http proxy:
https proxy with mTLS auth:
Note that tail (
-f
) support and https proxies only work with a fork of thegorilla/websocket
lib. There are open PRs that promise to add support for https proxies such as: gorilla/websocket#740Add the following to
go.mod
to use the fork with https support:I am maintaining a separate branch that includes the vendor'd fork here: https://github.com/planetscale/loki/tree/proxy-support
What this PR does / why we need it:
This PR makes it possible to connect
logcli
to Loki instances behind forward/CONNECT http and https proxies. This is already supported by other tools in this repo such aspromtail
via itsproxy_url
config flag.Special notes for your reviewer:
Checklist
CHANGELOG.md
.docs/sources/upgrading/_index.md