Skip to content

Commit

Permalink
Add another proxy list
Browse files Browse the repository at this point in the history
  • Loading branch information
ahobsonsayers committed Sep 25, 2024
1 parent 0dc7bb1 commit 9824328
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/testutils/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
const (
RoosterKidProxyListURL = "https://raw.githubusercontent.com/roosterkid/openproxylist/main/HTTPS_RAW.txt"
ProxlifyProxyListURL = "https://raw.githubusercontent.com/proxifly/free-proxy-list/main/proxies/protocols/http/data.txt" // nolint: revive
TheSpeedXProxyListURL = "https://raw.githubusercontent.com/TheSpeedX/PROXY-List/refs/heads/master/http.txt"
)

func NewProxyClient(proxyListUrls ...string) (*http.Client, error) {
Expand All @@ -39,7 +40,7 @@ func newProxyTransport(proxyListUrls []string) (http.RoundTripper, error) {
return nil, fmt.Errorf("error downloading proxy list: %w", err)
}

proxyLists = getWorkingProxies(proxyLists, 5*time.Second)
proxyLists = getWorkingProxies(proxyLists, 2*time.Second)
if len(proxyLists) == 0 {
return nil, errors.New("none of the proxies in the proxy list are working")
}
Expand Down
1 change: 1 addition & 0 deletions twickets/twickets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func TestGetLatestTickets(t *testing.T) {
httpClient, err := testutils.NewProxyClient(
testutils.RoosterKidProxyListURL,
testutils.ProxlifyProxyListURL,
testutils.TheSpeedXProxyListURL,
)
require.NoError(t, err)

Expand Down

0 comments on commit 9824328

Please sign in to comment.