phantomas
phantomas copied to clipboard
Test failed - request throttled by proxy. Is it possible to add custom header to a config?
Hello,
Is it possible to add a custom header to avoid throttling by such tools as Akamai etc.?
For example, check of https://darphin.com/ will always timeout.
I'm using yellowlab tools as an example but it fails in CLI too.
But with adding a custom request header this problem is gone. Such a feature is available on https://webpagetest.org
Please let me know if it's possible. I can also contribute but would appreciate a direction to make it happen faster. Thank you.
Good idea!
- First, you can take a look at a
userAgent
extension on how to handle options and customise puppeteer run. https://github.com/macbre/phantomas/blob/devel/extensions/userAgent/userAgent.js - And use puppeteer API to set a custom request header before the page is open. https://pptr.dev/#?product=Puppeteer&version=main&show=api-pagesetextrahttpheadersheaders
Let me know if you need more hints. Looking forward to the PR ;)