-
Notifications
You must be signed in to change notification settings - Fork 82
Open
Description
like NewQuoteFromYahoo, proxy and timeout parameter is useful when concurrent data downloading. Thank you.
func SetProxy(client *http.Client, proxyUrlString string) error {
if proxyUrlString == "" {
return nil
}
ui_proxy, err := url.Parse(proxyUrlString)
if err != nil {
return err
}
transport := http.DefaultTransport.(*http.Transport)
if client.Transport != nil {
transport = client.Transport.(*http.Transport)
}
transport.Proxy = http.ProxyURL(ui_proxy)
client.Transport = transport
return nil
}
func SetTimeout(client *http.Client, to time.Duration) {
client.Timeout = to
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels