go-rod / rod

A Chrome DevTools Protocol driver for web automation and scraping.
https://go-rod.github.io
MIT License
5.4k stars 355 forks source link

ctx.MustLoadResponse() Is not under proxy #725

Closed musicyin closed 2 years ago

musicyin commented 2 years ago

Rod Version: v0.109.3

browser := rod.New().ControlURL(ws).Trace(true).MustConnect().NoDefaultDevice()
        router.MustAdd("*SomeSpecificUrl*", func(ctx *rod.Hijack) {
            ctx.MustLoadResponse()
//RUN SOME FUNCTION
        })

What you got The Hijack request is not under proxy

What you expected to see The Hijack request is under proxy

What have you tried to solve the question hiclient := resty.New() hiclient.SetProxy(proxyserver)

and hijack with ctx.LoadResponse(hiclient.GetClient(), true) Although it can request under proxy , but it is not request through the browser It maybe detected by some website The situation is the browser (ws) provided ja3 spoof so i want to request through the browser that the ja3 fingerprint is not the same

ysmood commented 2 years ago

Can't reproduce your issue.

musicyin commented 2 years ago

Normal Request Code

err := page.Timeout(10 * time.Second).Navigate("https://client.tlsfingerprint.io:8443/")
if err != nil {
                fmt.Println(err.Error())
            } else {
                fmt.Println(page.MustHTML())
                break
            }

Hijacked Request Code

            router.MustAdd("*client.tlsfingerprint.io:8443/*", func(ctx *rod.Hijack) {
                ctx.MustLoadResponse()
                fmt.Println(ctx.Response.Body())
            })

What you got

NORMAL RESPONSE: ..........."id": "e47eae8f8c4887b6" .....

HIJACKED RESPONSE / OR Hijacked response with proxy ..........."id": "14062e58336049c2 .....

Which mean the request is under golang library that detected by some website.

What you expected to see Hijacked response some with normal response that ja3 fingerprint is the same.

ysmood commented 2 years ago

Duplicated #395