Last active
June 24, 2016 16:14
-
-
Save aliuygur/00f27e80d92b71d2582b80685147edb0 to your computer and use it in GitHub Desktop.
This file contains 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 ( | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) | |
func main() { | |
u, _ := url.Parse("https://leanfoods-9f12.restdb.io") | |
director := func(r *http.Request) { | |
r.URL.Host = u.Host | |
r.URL.Scheme = u.Scheme | |
r.Host = u.Host | |
} | |
proxy := &httputil.ReverseProxy{Director: director} | |
http.ListenAndServe(":9000", proxy) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment