-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release: ✨ Support extension 65037 as well as socks5h and socks4 prox…
…ies [1.0.25] (#308)
- Loading branch information
1 parent
a120dac
commit 9df73ca
Showing
20 changed files
with
6,248 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,25 +32,50 @@ func TestProxySuccess(t *testing.T) { | |
if resp.Status != 200 { | ||
t.Fatalf("Expected %d Got %d for Status", 200, resp.Status) | ||
} | ||
log.Print("Body: " + resp.Body) | ||
} | ||
func TestSocks4Proxy(t *testing.T) { | ||
if runtime.GOOS != "linux" { | ||
t.Skip("Skipping this test on non-linux platforms") | ||
return | ||
} | ||
client := cycletls.Init() | ||
resp, err := client.Do("https://ipinfo.io/json", cycletls.Options{ | ||
Body: "", | ||
Ja3: "771,4865-4867-4866-49195-49199-52393-52392-49196-49200-49162-49161-49171-49172-51-57-47-53-10,0-23-65281-10-11-35-16-5-51-43-13-45-28-21,29-23-24-25-256-257,0", | ||
UserAgent: "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0", | ||
Proxy: "socks4://abc:[email protected]:9050", | ||
Headers: map[string]string{ | ||
"Accept": "Application/json, text/plain, */*", | ||
}, | ||
}, "GET") | ||
if err != nil { | ||
t.Fatalf("Request Failed: " + err.Error()) | ||
} | ||
if resp.Status != 200 { | ||
t.Fatalf("Expected %d Got %d for Status", 200, resp.Status) | ||
} | ||
} | ||
|
||
// func TestHttpError(t *testing.T) { | ||
|
||
// client := cycletls.Init() | ||
// resp, err := client.Do("https://ipinfo.io/json", cycletls.Options{ | ||
// Body: "", | ||
// Ja3: "771,4865-4867-4866-49195-49199-52393-52392-49196-49200-49162-49161-49171-49172-51-57-47-53-10,0-23-65281-10-11-35-16-5-51-43-13-45-28-21,29-23-24-25-256-257,0", | ||
// UserAgent: "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0", | ||
// Proxy: "http://127.0.0.1:10809", | ||
// Headers: map[string]string{ | ||
// "Accept": "Application/json, text/plain, */*", | ||
// }, | ||
// }, "GET") | ||
// if err != nil { | ||
// log.Print("Request Failed: " + err.Error()) | ||
// } | ||
// log.Print("Status: " + strconv.Itoa(resp.Status)) | ||
// log.Print("Body: " + resp.Body) | ||
|
||
// } | ||
func TestSocks5hProxy(t *testing.T) { | ||
if runtime.GOOS != "linux" { | ||
t.Skip("Skipping this test on non-linux platforms") | ||
return | ||
} | ||
client := cycletls.Init() | ||
resp, err := client.Do("https://httpbin.org/ip", cycletls.Options{ | ||
Body: "", | ||
Ja3: "771,4865-4867-4866-49195-49199-52393-52392-49196-49200-49162-49161-49171-49172-51-57-47-53-10,0-23-65281-10-11-35-16-5-51-43-13-45-28-21,29-23-24-25-256-257,0", | ||
UserAgent: "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:87.0) Gecko/20100101 Firefox/87.0", | ||
Proxy: "socks5h://127.0.0.1:9050", | ||
Headers: map[string]string{ | ||
"Accept": "Application/json, text/plain, */*", | ||
}, | ||
}, "GET") | ||
if err != nil { | ||
t.Fatalf("Request Failed: " + err.Error()) | ||
} | ||
if resp.Status != 200 { | ||
t.Fatalf("Expected %d Got %d for Status", 200, resp.Status) | ||
} | ||
log.Print("Body: " + resp.Body) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.