Content-Length: 226122 | pFad | https://github.com/mubeng/mubeng/commit/aa6624ea8730a8755dc8276229397c2f528b1153

DE refactor(server): use `ProxyManager.Rotate` method · mubeng/mubeng@aa6624e · GitHub
Skip to content

Commit

Permalink
refactor(server): use ProxyManager.Rotate method
Browse files Browse the repository at this point in the history
Signed-off-by: Dwi Siswanto <git@dw1.io>
  • Loading branch information
dwisiswant0 committed Sep 3, 2024
1 parent 96de3aa commit aa6624e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions internal/server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/elazarl/goproxy"
"github.com/hashicorp/go-retryablehttp"
"github.com/kitabisa/mubeng/common"
"github.com/kitabisa/mubeng/pkg/helper"
"github.com/kitabisa/mubeng/pkg/mubeng"
)

Expand All @@ -24,13 +23,7 @@ func (p *Proxy) onRequest(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Reque

// Rotate proxy IP for every AFTER request
if (rotate == "") || (ok >= p.Options.Rotate) {
if p.Options.Method == "sequent" {
rotate = p.Options.ProxyManager.NextProxy()
}

if p.Options.Method == "random" {
rotate = p.Options.ProxyManager.RandomProxy()
}
rotate = p.Options.ProxyManager.Rotate(p.Options.Method)

if ok >= p.Options.Rotate {
ok = 1
Expand All @@ -39,7 +32,6 @@ func (p *Proxy) onRequest(req *http.Request, ctx *goproxy.ProxyCtx) (*http.Reque
ok++
}

rotate = helper.EvalFunc(rotate)
resChan := make(chan interface{})

go func(r *http.Request) {
Expand Down

0 comments on commit aa6624e

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/mubeng/mubeng/commit/aa6624ea8730a8755dc8276229397c2f528b1153

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy