Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
logcli: add --proxy-url flag for http/https proxy support
Add `--proxy-url` flag to `logcli` to support connecting to Loki instances running behind either HTTP or HTTPS CONNECT-style proxies. Examples: http proxy: ``` logcli \ --addr="http://loki-distributed-querier.loki.svc.cluster.local.:3100/" \ --proxy-url "http://envoy.dom.tld" \ query '{app"foo"}' ``` https proxy with mTLS auth: ``` logcli \ --addr="https://loki-distributed-querier.loki.svc.cluster.local.:3100/" \ --proxy-url "https://envoy.dom.tld" \ --cert tls.crt \ --key tls.key \ --ca-cert ca.crt \ query '{app"foo"}' ``` Note that tail (`-f`) support and https proxies only works with a fork of the `gorilla/websocket` lib. There are open PRs that promise to add support for https proxies such as: gorilla/websocket#740 Add the following to `go.mod` to use the fork with https support: ``` replace github.com/gorilla/websocket v1.4.2 => github.com/philipatl/websocket v1.4.3-0.20211206152948-d16969baa130 ```
- Loading branch information