I am trying to connect to a puppeteer instance that runs on a google cloud function v2.
This is the setup inside the function:
import getPort from 'get-port';
import puppeteer from "puppeteer-extra";
const port = await getPort();
const browser = await puppeteer.launch({
args: [
`--remote-debugging-port=${port}`,
],
});
console.log(browser.wsEndpoint());
this logged an endpoint. I copied that endpoint and tried to connect to from a client it via
await puppeteer.connect(myEndpoint);
but it threw an error:
SocketException: OS Error: The remote computer refused the network connection.
How can I fix that?