zfcsoftware / puppeteer-real-browser

This package is designed to bypass puppeteer's bot-detecting captchas such as Cloudflare. It acts like a real browser and can be managed with puppeteer.
https://www.npmjs.com/package/puppeteer-real-browser
MIT License
622 stars 84 forks source link

Can not launch real browser with Ubuntu #168

Closed meotimdihia closed 2 weeks ago

meotimdihia commented 2 weeks ago

Describe the bug I tried to open a real browser in Ubuntu (I connect remotely to it) but it doesn't work, it looks like it always uses Xvfb, even though I disabled it.

 await connect({
    headless: "false",
    disableXvfb: true,
    turnstile: true,
  })

the option headless: false works fine with Playwright. => I guess the problem belongs to puppeteer-real-browser

zfcsoftware commented 2 weeks ago

Xvfb will never create a virtual screen when disableXvfb: true is set. I don't have this problem on my local ubuntu computer with a screen. disableXvfb is only for browser tests. You need to use Xvfb in production environment. If the server you are testing does not have a screen, I cannot support this. You can check how Playwright launches Chrome in headless: false mode on servers without a screen and edit the Dockerfile file accordingly.

zfcsoftware commented 2 weeks ago

Can you also try using headless: false instead of headless: 'false'?

meotimdihia commented 2 weeks ago

@zfcsoftware the server doesn't have a screen. I only installed ubuntu-desktop and connected remotely to it.

So we have to need a screen to do this work. But the Playwright works fine in this case.

You can check how Playwright launches Chrome in headless: false mode on servers without a screen and edit the Dockerfile file accordingly.

I'll check how to do it.

zfcsoftware commented 2 weeks ago

@zfcsoftware the server doesn't have a screen. I only installed ubuntu-desktop and connected remotely to it.

So we have to need a screen to do this work. But the Playwright works fine in this case.

You can check how Playwright launches Chrome in headless: false mode on servers without a screen and edit the Dockerfile file accordingly.

I'll check how to do it.

The library is designed to use Xvfb on servers without a display. Therefore, I can't provide support on this matter, but if you find a solution, I would be happy to update the library. Since using the library without Xvfb on headless Linux servers is outside the scope of the library, I'm closing this discussion. If you find a method, feel free to add it here, and I can implement it into the library. Thank you.

meotimdihia commented 2 weeks ago

thanks, It looks like I didn't understand this. Cloudflare always detects if we have a real display or not anyway.