Golang: How to Use Forward Proxy for HTTP Requests?

14 Replies, 863 Views

Yo, I had the same issue when I was learning golang how to use forward proxy. What worked for me was setting the `HTTP_PROXY` env variable. Just do:

```bash
export HTTP_PROXY=http://your-proxy:port
```

Then your Go code will automatically pick it up. For local testing, I used [Charles Proxy](https://www.charlesproxy.com/). It’s super easy to set up and debug.

Good luck!

Messages In This Thread



Users browsing this thread: 1 Guest(s)