|
Script Autocofigurazione Proxy |
|
|
|
|
Scritto da Alessandro Pensato
|
|
Venerdì 14 Gennaio 2011 11:44 |
|
Lo script VBS qui di seguito serve per impostare su un pc con sistema operativo Windows XP/Vista/7 la stringa per la ricerca del proxy.pac.
set WSHShell = WScript.CreateObject("WScript.Shell") WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer", ""WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable", 0, "REG_DWORD"WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyOverride", ""WSHShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\AutoConfigURL", "http://proxy.porkyhttp.no-ip.info/proxy.pac"
Mentre questo è un esempio di proxy.pac che utilizzo con Squid per mascherare le richieste verso gli host o domini definiti, mentre tutto il resto passa al di fuori del proxy.
function FindProxyForURL(url, host) { if ( shExpMatch(host, "*.pi.cnr.it") || shExpMatch(host, "*.ge.cnr.it") || shExpMatch(host, "*.bo.cnr.it") || shExpMatch(host, "*.aasldjournals.org") || shExpMatch(host, "*.sepmonline.org") || shExpMatch(host, "*.journal.informs.org") || localHostOrDomainIs(host, "ajp.amjpathol.org") || localHostOrDomainIs(host, "sviluppo.aiaf.it") || localHostOrDomainIs(host, "inscribe.iupress.org") || localHostOrDomainIs(host, "www.reaxys.com") || localHostOrDomainIs(host, "www.morganclaypool.com") ) return "PROXY proxy.porkyhttp.no-ip.info:3128"; else return "DIRECT"; }
|