V
V
Vyacheslav Grachunov2018-06-29 00:03:15
Google Chrome
Vyacheslav Grachunov, 2018-06-29 00:03:15

How to connect to a password-protected proxy in a Chrome extension?

Subject
I do something like this:

var config = {
        mode: "fixed_servers",
        rules: {
          proxyForHttp: {
            scheme: "http",
            host: "ip_adress",
            port: port
          },
          proxyForHttps: {
            scheme: "http",
            host: "ip_adress",
            port: port
          },
          bypassList: ["*site1.com", "*site2.com"]
        }
      };

But a proxy with a password - and it either asks for a username and password, or stupidly 407.
The proxy changes the port, so you can't just save it once.
How can you do? The manual does not say anything about a login with a password.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Bobylev, 2018-07-01
@Qwentor

Try listening and handling the chrome.webRequest.onAuthRequired event
https://developer.chrome.com/extensions/webRequest...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question