package main import ( "github.com/gogf/gf/net/ghttp" "net/http" "net/url" "time" ) func main() { task := ghttp.NewClient() urli := url.URL{} urlproxy, _ := urli.Parse("http://127.0.0.1:8080") task.Transport = &http.Transport{ Proxy: http.ProxyURL(urlproxy), } task.SetTimeOut(time.Second * 15) task.Get("http://www.baidu.com") }