i have a script that use node js and puppeteer, the script run wonderful on my windows 10 for as long as i dont close it from command line, when i`m using it .
on my VPS it is working for exactly 30 minute , i tried few times and all the time it is exactly 30 minutes, the node js is still functioning but no data is received after 30 minutes, i`m scraping web socket just for the info .
i have tried any args on launch but nothing is keep the connection alive.
2
Answers
finally i found a solution :) i guess the sites checking your activity and if you are not active for 30 minutes then they closing any connection that is open , so with puppeteer you can use mouse movement and that is the solution , i put movement in interval and all are fine now, if someone have that issue then just use this method and all are good.
Have you tried resetting the websocket connection yourself to bypass the issue? Not sure the application here, but a simple “disconnect – reconnect” every 29 minutes (or every minute for that matter) might just do the trick?