Skip to content

Instantly share code, notes, and snippets.

@bcho
Created April 3, 2015 14:37
Show Gist options
  • Select an option

  • Save bcho/bf423fd80de8245f34bf to your computer and use it in GitHub Desktop.

Select an option

Save bcho/bf423fd80de8245f34bf to your computer and use it in GitHub Desktop.
trick
package main
import (
"log"
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
u, err := url.Parse("http://192.168.33.11:8086")
if err != nil {
log.Fatal(err)
}
proxyHandler := httputil.NewSingleHostReverseProxy(u)
http.Handle("/", proxyHandler)
log.Fatal(http.ListenAndServe("0.0.0.0:8086", nil))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment