Después de hacer clic en el botón Establecer proxy, mi proxy de socks5 se configurará, pero ¿cómo puedo obligar al navegador a usar el proxy para dominios específicos, como site.com ? tenga en cuenta que quiero usar fixed_servers y la regla singleProxy . Configuré mi configuración de proxy de la siguiente manera, ¡pero funciona en cualquier dominio...!
manifiesto.json
"permissions":["tabs","proxy"]emergente.js
$('#btnSetProxy').click(function () { var config = { mode: "fixed_servers", rules: { singleProxy: { scheme: 'socks5', host: '192.168.1.25', port: 7598 }, bypassList: ["127.0.0.1/8", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "<local>"] } }; chrome.proxy.settings.set( {value: config, scope: 'regular'}, function() {}); });ventana emergente.html
<!DOCTYPE html> <html> <head> <script src="js/popup.js"></script> <link rel="stylesheet" href="css/popup.css"> </head> <body id="secbody" class="dirrtl"> <button type="button" id="btnSetProxy">Set Proxy</button> </body> </html>