Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy usage clarification #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,20 @@ Calling `akamai update` with no arguments will update _all_ packages installed u

Manually upgrade Akamai CLI to the latest version.

#### Using proxy server

```
akamai [command] [action] [arguments...] --proxy http://user:password@proxy.io.com:8080
```

Alternatively you can use following commands. Both cases are equal.

```
export http_proxy="http://user:password@proxy.io.com:8080"
export https_proxy="http://user:password@proxy.io.com:8080"
akamai [command] [action] [arguments...]
```

### Installed Commands

To call an installed command, use `akamai <command> [args]`, e.g.
Expand Down
8 changes: 3 additions & 5 deletions akamai.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func createApp() {
},
cli.StringFlag{
Name: "proxy",
Usage: "Set a proxy to use",
Usage: "Provide your proxy (http://user:password@proxy.io.com:8080)",
},
cli.BoolFlag{
Name: "daemon",
Expand All @@ -79,10 +79,8 @@ func createApp() {
proxy := c.String("proxy")
os.Setenv("HTTP_PROXY", proxy)
os.Setenv("http_proxy", proxy)
if strings.HasPrefix(proxy, "https") {
os.Setenv("HTTPS_PROXY", proxy)
os.Setenv("https_proxy", proxy)
}
os.Setenv("HTTPS_PROXY", proxy)
os.Setenv("https_proxy", proxy)
}

if c.IsSet("daemon") {
Expand Down