We had a short talk about HTTP proxies in Go. As expected, Go supports the
usual environment variables, like
and you can easily customize the proxy selection, as we saw in an example code
walkthrough of an ip rotation proxy.
The x/net package contains support in x/net/http/httpproxy.
A couple of fun facts from the talk:
- The first book on HTTP proxies was published in 1998: “Web Proxy Servers” by Ari Luotonen (CERN), who also wrote a web proxy tunneling draft.
- Many popular HTTP projects (including Go) were affected by a critical CVE, related to CGI up until 2016. Note that the discussion and development of “server scripts” started in 1993.
- Core curl developer explains,
why curl does not follow RFC in each and every aspect, e.g. when it comes to
Proxy-Connectionheader - he sums it up as “The world wild web is a crazy place.”
The presentation can be found here: HTTP Getaway (part 2): HTTP proxy intro
See you next time!