Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
How to throw exception if proxy is temporary down and reload browser in node.js?
 async function run() {
  const browser = await puppeteer.launch({
    args: ['--proxy-server=185.209.177.12:8080'],
    headless: false,
  });

I want node.js to reload browser and try again if proxy is down. The script gets stop executing when proxy is down I want it to continue executing**.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Could you do something like this?

async function run() {
  while (true) {
    try {
      browser = await puppeteer.launch({
        headless: true,
        args: ["--proxy-server=185.209.177.12:8080"],
      });
      break;
    } catch (e) {
      console.log("Proxy temporarily unavailable, retrying...");
      await sleep(5000);
    }
  }
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!