I found an easier way to do this with a Go program that doesn't require writing a script and installing node. Check out this comment.
Some programs support a proxy, but they don't support authentication without prompting. This is the case with Chrome and VSCode. This caused me problems particularly when trying to automate Chrome with Selenium. The workaround is to run a local proxy, set your http_proxy
environment variables to the local proxy, and tell the local proxy to, in turn, proxy requests to your real proxy and to include your username and password.