Try to use example code from this article https://datascrape.tech/blog/scriptable-and-headless-wb/
There are two code examples, Selenium and Playwrite, that both use proxies. Also, doublecheck that your proxy is working using cURL