Skip to content

Commit fa93813

Browse files
author
Max Siegieda
authored
Merge pull request #27 from ReconfigureIO/fix/use-proxy
Set Proxy for http calls if set in environment
2 parents 7428d0d + f033357 commit fa93813

7 files changed

+16
-6
lines changed

cmd/completion.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package cmd
22

33
import (
4-
"github.com/ReconfigureIO/reco/logger"
54
"github.com/ReconfigureIO/cobra"
5+
"github.com/ReconfigureIO/reco/logger"
66
)
77

88
// completionCmd represents the completion command

cmd/config.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"os"
66
"path/filepath"
77

8-
"github.com/ReconfigureIO/reco/logger"
98
"github.com/ReconfigureIO/cobra"
9+
"github.com/ReconfigureIO/reco/logger"
1010
)
1111

1212
// configCmd represents the config command

cmd/graph.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,4 @@ func validGraphDir(srcDir string) bool {
111111
return false
112112
}
113113
return true
114-
}
114+
}

cmd/project.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ This is a directory level configuration so you need to check in each new locatio
5353
Use: "list",
5454
Aliases: []string{"ls", "lst", "lists"},
5555
Short: "List all projects for your account",
56-
Long: `List all projects for your account.
56+
Long: `List all projects for your account.
5757
If you have an active project set for your current location this will be highlighted in the list.`,
5858
Run: listProject,
5959
PostRun: listPostRun,

glide.lock

+4-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

glide.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ import:
1616
- package: github.com/skratchdot/open-golang
1717
subpackages:
1818
- open
19+
- package: github.com/mattn/go-ieproxy

request.go

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package reco
22

33
import (
44
"context"
5+
"github.com/mattn/go-ieproxy"
56
"io"
67
"net/http"
78
"net/url"
@@ -63,6 +64,11 @@ var (
6364
}
6465
)
6566

67+
func init() {
68+
ieproxy.OverrideEnvWithStaticProxy()
69+
http.DefaultTransport.(*http.Transport).Proxy = http.ProxyFromEnvironment
70+
}
71+
6672
// endpoint string, params urlParams, body io.Reader
6773
type clientRequest struct {
6874
endpoint string
@@ -133,6 +139,7 @@ func (p *clientRequest) Do(method string, body interface{}) (*http.Response, err
133139
}
134140
}
135141
req.SetBasicAuth(p.username, p.password)
142+
136143
resp, err := httpClient.Do(req)
137144
if resp != nil {
138145
switch resp.StatusCode {

0 commit comments

Comments
 (0)