Skip to content

Commit

Permalink
work behind proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
kevincobain2000 committed Dec 12, 2023
1 parent 27c2c58 commit 048a473
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions helpers.go
Expand Up @@ -6,15 +6,13 @@ import (
"fmt"
"io"
"log"
"net"
"net/http"
"os"
"path/filepath"
"regexp"
"runtime"
"sort"
"strings"
"time"

"github.com/Masterminds/semver"
"github.com/c4milo/unpackit"
Expand Down Expand Up @@ -408,16 +406,7 @@ func (gb *GoBrew) getGolangVersions() (result []string) {
}

func doRequest(url string) (data []byte) {
client := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyFromEnvironment,
Dial: (&net.Dialer{
Timeout: 5 * time.Second,
}).Dial,
TLSHandshakeTimeout: 5 * time.Second,
},
Timeout: 10 * time.Second,
}
client := &http.Client{}
request, err := http.NewRequest("GET", url, nil)
utils.CheckError(err, "==> [Error] Cannot create request")

Expand Down

0 comments on commit 048a473

Please sign in to comment.