fix SetProxy lint error.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2016-07-31 20:58:13 +08:00
parent ed1ce197cb
commit c2b4d31419
1 changed files with 3 additions and 2 deletions

View File

@ -118,15 +118,16 @@ func CheckMessage(req PushNotification) error {
return nil
}
// SetProxy only working for GCM server.
func SetProxy(proxy string) error {
proxyUrl, err := url.ParseRequestURI(proxy)
proxyURL, err := url.ParseRequestURI(proxy)
if err != nil {
return err
}
http.DefaultTransport = &http.Transport{Proxy: http.ProxyURL(proxyUrl)}
http.DefaultTransport = &http.Transport{Proxy: http.ProxyURL(proxyURL)}
LogAccess.Debug("Set http proxy as " + proxy)
return nil