Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use NewTransportWithProxy? #333

Open
Estr0gen opened this issue Mar 12, 2024 · 6 comments
Open

How to use NewTransportWithProxy? #333

Estr0gen opened this issue Mar 12, 2024 · 6 comments
Assignees
Labels
triage This ticket will be looked at shortly

Comments

@Estr0gen
Copy link

Description

How do I use NewTransportWithProxy? I cannot seem to find any example of it. Thanks.

Issue Type

Support

Operating System

Linux

Node Version

None

Golang Version

None

Relevant Log Output

No response

@Estr0gen Estr0gen added the triage This ticket will be looked at shortly label Mar 12, 2024
@tim-belanenko
Copy link

Usage example

func TestProxySuccess(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: "socks5://abc:123@127.0.0.1:1087",
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)
}

@Estr0gen
Copy link
Author

Usage example

func TestProxySuccess(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: "socks5://abc:123@127.0.0.1:1087",
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)
}

Yes, but that is only with the CycleTLS client, not the fhttp transport.

@tim-belanenko
Copy link

Usage example

func TestProxySuccess(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: "socks5://abc:123@127.0.0.1:1087",
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)
}

Yes, but that is only with the CycleTLS client, not the fhttp transport.

I have same problem :(

@akudnamor
Copy link

find a solution????????

@Tanjhand
Copy link

Ja3 := "771,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,65037-45-16-0-13-43-18-11-65281-23-17513-5-51-10-35-27,25497-29-23-24,0"
	UserAgent := headers["user-agent"]
	dialer, err := cycletls.NewConnectDialer("http://"+args.IpSession, UserAgent)
	if err != nil {
		log.Println(err)
	}
	sess.Transport = cycletls.NewTransportWithProxy(Ja3, UserAgent, dialer)

@Tanjhand
Copy link

NewConnectDialer

copy C:\Users\Administrator\go\pkg\mod\github.com!danny-!dasilva!cycle!t!l!s\cycletls@v1.0.26\connect.go newConnectDialer to
NewConnectDialer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage This ticket will be looked at shortly
Projects
None yet
Development

No branches or pull requests

5 participants