I have a Bitnami Lightsail instance on AWS with Debian OS, where I have successfully installed the Google Chrome browser. My goal is to create a web application similar to Facebook or WhatsApp Web, where I can monitor the online/offline status of users. To achieve this, I have specific requirements:
I've created a Puppeteer script to open a webpage, but I'm unsure how to open an admin panel, which is necessary for entering admin details or scanning a QR code like WhatsApp Web. After login that webpage should run continuously in the background on the server.
For example, consider the scenario of having web.whatsapp.com open after scanning qr code then i can see each user online offline status. If there is no option to access this admin panel via SSH, how can I open Chrome via SSH/ftp/web for login? This Chrome instance must be private only accessible by SSH and runs 24x7 in the background, with no external web access.
After logging in, I also need to open a separate user message window via REST API or socket for each user.
I have successfully installed Google Chrome on my instance, but I'm uncertain how to proceed with opening private webpages programmatically and accessing them via SSH for admin tracking.
Can someone provide guidance or a step-by-step approach on how to achieve this? Any suggestions or code examples would be greatly appreciated.
JS script
const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch({ executablePath: 'opt/google/chrome/chrome', // Provide the path to Chrome executable headless: true, // or false depending on your requirements }); // Open WhatsApp Web const page = await browser.newPage(); await page.goto('https://adminPanel.example.com/', { waitUntil: 'networkidle0' }); // You can add more code here to interact with WhatsApp Web if needed // Check if the QR code element is present (indicating the page is open) // Close the browser after your interactions are complete //await browser.close(); // Keep the script running //await new Promise(() => {}); })();