Using a proxy

A forward proxy can be useful for many things, including viewing the HTTP traffic, debugging an application, reverse engineering an API, and manipulating headers, and it can potentially be used to increase your anonymity to the target server. However, be aware that many proxy servers still forward your original IP using an X-Forwarded-For header.

You can use your environment variables to set a proxy or explicitly set a proxy with your request. The Go HTTP client supports HTTP, HTTPS, and SOCKS5 proxies, such as Tor.

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.