Hacker News new | ask | show | jobs
by farslan 4650 days ago
The inbuilt reverseproxy is also handy for small tasks:

    package main

    import (
    	"net/http"
    	"net/http/httputil"
    	"net/url"
    )

    func main() {
    	target, _ := url.Parse("http://127.0.0.1:8000")
    	http.ListenAndServe(":80", httputil.NewSingleHostReverseProxy(target))
    }
This will http proxy :80 to :8000.