Extending Golang’s Single Host Reverse Proxy

Golang provides a simple HTTP Utility called ReverseProxy which makes it dead simple to create a ReverseProxy as such: package main import ( "fmt" "io/ioutil" "log" "net/http" "net/http/httptest" "net/http/httputil" "net/url" ) func main() { backendServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "this call was relayed by the reverse proxy") })) defer backendServer.Close() rpURL, err := url.Parse(backendServer.URL) if err != nil { log.Fatal(err) } frontendProxy := httptest.NewServer(httputil.NewSingleHostReverseProxy(rpURL)) defer frontendProxy.Close() resp, err := http.
Read more →

A New Beginning

A Fresh Start Just like it says, I am taking another start at blogging. I have grown super tired and frankly hate mainstream social media, and so I am pulling back from the grind of it, and keeping things simple. I am going to archive all my old posts, and then as time permits I will pull them into a live archive to be perused, but I am not making any promises on when that will be happening.
Read more →