How to set up a proxy address not for all sites but, for example, for all *.*.it sites. So I need to use only the country part.
It is better for me to use Windows 7 settings (maybe cmd) instead of a program.
Asked
Active
Viewed 75 times
1
oleedd
- 11
- 2
-
Does this answer your question? [Using a proxy for certain sites only](https://superuser.com/questions/417896/using-a-proxy-for-certain-sites-only) – music2myear Jun 06 '22 at 03:45
-
@music2myear No, it doesn't. – oleedd Jun 06 '22 at 06:20
-
You'll probably want to use a proxy auto configuration (PAC) script for this, coupled with a group policy for Windows 7 PCs only. The PAC script can contain conditional rules for each site. For example, `function FindProxyForURL(url, host) { if (host.match(/\.it$/)) return 'PROXY ITPROXY:8080'; if (host.match(/\.cn$/)) return 'PROXY CNPROXY:8081'; return 'PROXY DEFAULTPROXY:80; DIRECT'; }` – leeharvey1 Jun 06 '22 at 13:11
-
@leeharvey1 Yes, cool. Where to add this in Windows 7? – oleedd Jun 06 '22 at 17:39
-
Save it to a .pac file. Host the .pac file on an intranet web server for Windows 7 PCs. Set the .pac file URL in Internet Explorer > Tools > Internet Options > Connections tab > LAN settings > [X] Use automatic configuration script, Address field. Enforce this IE setting via group policy -- which is beyond the scope (See [this](https://techexpert.tips/windows/gpo-proxy-auto-configuration-script/) and [this](https://theitbros.com/config-internet-explorer-11-proxy-settings-gpo/), [etc](http://woshub.com/configure-internet-explorer-10-and-11-settings-using-gpo-in-windows-server-2012/)) – leeharvey1 Jun 07 '22 at 11:10
-
@leeharvey1 I don't use Internet Explorer. Will it work in Chrome? And I don't have a web server. – oleedd Jun 07 '22 at 13:34
-
Yes, Chrome obeys Internet Explorer's proxy setting. However, use of local `file://` URL hosting for .pac files is now considered unsafe, and [may now be deprecated](https://superuser.com/questions/191037/local-pac-file-url-format-that-works-with-ie-and-safari-windows). FYI, most proxy servers themselves may allow .pac file hosting. ;) – leeharvey1 Jun 08 '22 at 10:14
-
@leeharvey1 *FYI, most proxy servers themselves may allow .pac file hosting* — but how to know if it is and do that? I just take a free proxy address from a site. – oleedd Jun 08 '22 at 15:43