Skip to content

Commit

Permalink
Merge pull request #21 from ddosify/add-proxy-done
Browse files Browse the repository at this point in the history
Add Done method
  • Loading branch information
fatihbaltaci authored Oct 23, 2021
2 parents c2b5670 + 94ae7b8 commit 3855d68
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func (e *engine) stop() {
close(e.responseChan)
<-e.reportService.DoneChan()
e.reportService.Report()
e.proxyService.Done()
}

func (e *engine) initReqCountArr() {
Expand Down
1 change: 1 addition & 0 deletions core/proxy/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ type ProxyService interface {
GetProxy() *url.URL
ReportProxy(addr *url.URL, reason string) *url.URL
GetProxyCountry(*url.URL) string
Done() error
}

// NewProxyService is the factory method of the ProxyService.
Expand Down
4 changes: 4 additions & 0 deletions core/proxy/single.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ func (sp *singleProxyStrategy) ReportProxy(addr *url.URL, reason string) *url.UR
func (sp *singleProxyStrategy) GetProxyCountry(addr *url.URL) string {
return "unknown"
}

func (sp *singleProxyStrategy) Done() error {
return nil
}

0 comments on commit 3855d68

Please sign in to comment.