Puppeteer supports connection to the browser either using a websocket (default) or using a pipe.
puppeteer.launch({ pipe: true });
What are the advantages of either of those approaches? Why would I choose one over the other? What are their disadvantages?
pipes
should be your default if you run everything (puppeteer and chromium) in the same server. They are even considering making that the default. The pro is that's a private connection between puppeteer and chromium. You are not opening a WebSocket to "the world". The con is that you can't re-use the chromium instance with another puppeteer process.
I think you can infer the pros and cons of WebSockets
from the previous paragraphs. You would use WebSocket
if you need to share a chromium instance across many puppeteer processes or from a different computer.
There are no big differences in performance though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With