Created
April 3, 2015 14:37
-
-
Save bcho/bf423fd80de8245f34bf to your computer and use it in GitHub Desktop.
trick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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