Skip to content

Commit

Permalink
fix SetProxy lint error.
Browse files Browse the repository at this point in the history
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
  • Loading branch information
appleboy committed Jul 31, 2016
1 parent ed1ce19 commit c2b4d31
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gorush/notification.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c2b4d31

Please sign in to comment.