1
0
Fork 0

Merge pull request #593 from rqlite/http_proxy

Add HTTP proxy (from environment) support
master
Philip O'Toole 5 years ago committed by GitHub
commit 9ed17cc390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,4 +1,5 @@
## 4.6.0 (unreleased)
- [PR #593](https://github.com/rqlite/rqlite/pull/593): rqlite CLI now supports HTTP proxy. Thanks @paulstuart
- [PR #592](https://github.com/rqlite/rqlite/pull/592): Add .dump to CLI.
- [PR #591](https://github.com/rqlite/rqlite/pull/591): Store layer supports generating SQL format backups.
- [PR #590](https://github.com/rqlite/rqlite/pull/590): DB layer supports generating SQL format backups.

@ -99,6 +99,7 @@ func makeRestoreRequest(restoreFile io.Reader) func(string) (*http.Request, erro
func restore(ctx *cli.Context, filename string, argv *argT) error {
statusURL := fmt.Sprintf("%s://%s:%d/status", argv.Protocol, argv.Host, argv.Port)
client := http.Client{Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
TLSClientConfig: &tls.Config{InsecureSkipVerify: argv.Insecure},
}}
statusResp, err := client.Get(statusURL)

@ -178,6 +178,7 @@ func sendRequest(ctx *cli.Context, makeNewRequest func(string) (*http.Request, e
client := http.Client{Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: argv.Insecure, RootCAs: rootCAs},
Proxy: http.ProxyFromEnvironment,
}}
// Explicitly handle redirects.
@ -261,6 +262,7 @@ func cliJSON(ctx *cli.Context, cmd, line, url string, argv *argT) error {
client := http.Client{Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: argv.Insecure},
Proxy: http.ProxyFromEnvironment,
}}
resp, err := client.Get(url)
if err != nil {

Loading…
Cancel
Save