Golang net/http.ProxyURL() function example

package net/http

Golang net/http.ProxyURL() function usage example

 proxyUrl, err := url.Parse("http://ip-address:port")

 http.DefaultTransport = &http.Transport{
 Proxy: http.ProxyURL(proxyUrl)
 }

Reference :

http://golang.org/pkg/net/http/#ProxyURL

Advertisement