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

puppeteer with proxy doesn't work #12213

Open
vikasg603 opened this issue Jun 27, 2024 · 1 comment
Open

puppeteer with proxy doesn't work #12213

vikasg603 opened this issue Jun 27, 2024 · 1 comment
Labels
bug Something isn't working needs triage

Comments

@vikasg603
Copy link

What version of Bun is running?

1.1.17+bb66bba1b

What platform is your computer?

Darwin 23.5.0 arm64 arm

What steps can reproduce the bug?

Run the below code
import { launch } from 'puppeteer'

import { anonymizeProxy } from 'proxy-chain'

const example = async () => {

    const localProxy = await anonymizeProxy('http://username:password@host:port')

    const browser = await launch({
        headless: false,
        devtools: true,
        args: [
            `--user-agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36`,
            // add proxy http proxy
            `--proxy-server=${localProxy}`
        ]
    })

    const [page] = await browser.pages()

    await page.goto('https://google.com')
}

example()

Make sure to update the proxy.

What is the expected behavior?

It should open the browser window with google.com open

What do you see instead?

170 | ensureNewDocumentNavigation = !!response.loaderId;
171 | if (response.errorText === 'net::ERR_HTTP_RESPONSE_CODE_FAILURE') {
172 | return null;
173 | }
174 | return response.errorText
175 | ? new Error(${response.errorText} at ${url})
^
error: net::ERR_TUNNEL_CONNECTION_FAILED at https://google.com
at /Users/vikas/Documents/tmp/demo/node_modules/puppeteer-core/lib/esm/puppeteer/cdp/Frame.js:175:27

Bun v1.1.17 (macOS arm64)

Additional information

I even tried the same with the help of https://www.npmjs.com/package/puppeteer-page-proxy
Not getting the same error, but still page doesn't load at all.

@vikasg603 vikasg603 added bug Something isn't working needs triage labels Jun 27, 2024
@cleiltonoliveira
Copy link

I'm having the same here, has anyone resolved this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
None yet
Development

No branches or pull requests

2 participants