Golang how to use forward http proxy – Best way to configure it? or How to set up a forward HTTP prox

18 Replies, 1308 Views

kinda surprised no one mentioned `ProxyFromEnvironment` yet. for golang how to use forward http proxy, it’s a neat middle ground:

```go
client := &http.Client{
Transport: &http.Transport{Proxy: http.ProxyFromEnvironment},
}
```

But yeah, manual config is better for anything serious.

PS: if you’re on Windows, watch out for system proxy settings messing with your code.

Messages In This Thread



Users browsing this thread: 1 Guest(s)