Example #1
0
func (this *Updater) isAgentServerOK() bool {
	_, err := common.NewProxy().GetOneProxy("http://example.com")
	if err != nil {
		return false
	}
	return true
}
func (this *ProxyPlugin) Do(pluginType PluginType, args ...interface{}) {
	if pluginType == BeforeDownloaderType {
		req := args[0].(*common.Request)
		var err error
		req.ProxyUrl, err = common.NewProxy().GetOneProxy(req.Url)
		if err != nil {
			req.Error = err
		}
	}
}