Golang net/http/httputil.NewSingleHostReverseProxy() function example
package net/http/httputil
Golang net/http/httputil.NewSingleHostReverseProxy() function usage example
rawURL := "http://username:password@searchengine.com:8080/testpath/?q=socketloop.com#TestFunc"
backendURL, err := url.Parse(rawURL)
if err != nil {
panic(err)
}
reverseProxyHandler := httputil.NewSingleHostReverseProxy(backendURL)
Reference :
http://golang.org/pkg/net/http/httputil/#NewSingleHostReverseProxy
Advertisement
Something interesting
Tutorials
+7.5k Golang : Dealing with struct's private part
+10.6k Golang : Simple File Server
+7.2k Golang : Check if one string(rune) is permutation of another string(rune)
+14.4k Golang : How to convert a number to words
+8.2k Golang : Add build version and other information in executables
+5.8k Cash Flow : 50 days to pay your credit card debt
+7.6k Golang : Convert(cast) io.Reader type to string
+6.1k Golang : Grab news article text and use NLP to get each paragraph's sentences
+12k Golang : Convert a rune to unicode style string \u
+9.8k Golang : Resumable upload to Google Drive(RESTful) example
+25.8k Golang : Daemonizing a simple web server process example
+8.6k Golang : Convert(cast) []byte to io.Reader type