Automatische Proxy Einstellungen (TH-Wildau)

Neues Semester und jetzt gibt es vom HRZ auch automatische Proxy Einstellungen. Zugegeben, aufgrund der Vielzahl an Geräten nicht ganz einfach, aber solch eine .pac / .dat Datei sieht mehr nach einen Prototypen bzw trial and error aus.

====
ftp.th-wildau.de/proxy.pac

function FindProxyForURL(url, host) {
	// If URL has no dots in host name, send traffic direct.
	//if (isPlainHostName(host))
	//	return "DIRECT";

// If specific URL needs to bypass proxy, send traffic direct.
	if (shExpMatch(url,"*th-wildau.de*") ||
	    shExpMatch(url,"*tfh-wildau.de*"))
		return "DIRECT";

// If IP address is internal or hostname resolves to internal IP, send direct.

	var resolved_ip = dnsResolve(host);

	if (isInNet(resolved_ip, "10.100.12.*", "255.0.0.0") ||
		//isInNet(resolved_ip, "172.16.0.0",  "255.240.0.0") ||
		//isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") ||
		isInNet(resolved_ip, "127.0.0.0", "255.255.255.0"))
		return "DIRECT";

	//if (isInNet(resolved_ip, "194.95.48.*", "255.255.255.0") ||
		//isInNet(resolved_ip, "172.16.0.0",  "255.240.0.0") ||
		//isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") ||
		//isInNet(resolved_ip, "127.0.0.0", "255.255.255.0"))
		//return "PROXY proxy.th-wildau.de:8080; DIRECT";

// If not on a internal/LAN IP address, send traffic direct.
	if (!isInNet(myIpAddress(), "194.95.48.*","255.255.255.0"))
		return "PROXY proxy.th-wildau.de:8080; DIRECT"
	if (!isInNet(myIpAddress(), "10.100.12.*","255.255.255.0"))
		return "PROXY proxy.th-wildau.de:8080; DIRECT";

// All other traffic uses below proxies, in fail-over order.
	return "PROXY proxy.th-wildau.de:8080; DIRECT";
}

====
ftp.th-wildau.de/proxy2.pac

function FindProxyForURL(url, host) {
	// If URL has no dots in host name, send traffic direct.
	if (isPlainHostName(host))
	{
    return "DIRECT";
  }

// If specific URL needs to bypass proxy, send traffic direct.
	if (shExpMatch(url,"*th-wildau.de*") ||
	    shExpMatch(url,"*tfh-wildau.de*"))
		{
    return "DIRECT";
    }



//reip = /^d+.d+.d+.d+$/g;
//if (reip.test(host)) {
         if ( isInNet(host, "194.95.50.0", "255.255.255.0") ||
              isInNet(host, "194.95.49.0", "255.255.255.0") ||
              isInNet(host, "194.95.48.0", "255.255.255.0") ||
              isInNet(host, "194.95.46.0", "255.255.254.0") ||
              isInNet(host, "194.95.45.0", "255.255.255.0") ||
              isInNet(host, "194.95.44.0", "255.255.255.0") ||
              isInNet(host, "193.175.213.0", "255.255.255.0") ||
              isInNet(host, "10.100.0.0", "255.255.252.0") ||
              isInNet(host, "10.100.4.0", "255.255.252.0") ||
              isInNet(host, "10.100.8.0", "255.255.252.0")
          ) {
             return "DIRECT";
        }
//	}


	var resolved_ip = dnsResolve(host);

	//if (isInNet(resolved_ip, "10.100.12.*", "255.0.0.0") ||
		//isInNet(resolved_ip, "172.16.0.0",  "255.240.0.0") ||
		//isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") ||
	//	isInNet(resolved_ip, "127.0.0.0", "255.255.255.0"))
	//	return "DIRECT";

	//if (isInNet(resolved_ip, "194.95.48.*", "255.255.255.0") ||
		//isInNet(resolved_ip, "172.16.0.0",  "255.240.0.0") ||
		//isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") ||
		//isInNet(resolved_ip, "127.0.0.0", "255.255.255.0"))
		//return "PROXY proxy.th-wildau.de:8080; DIRECT";

// If not on a internal/LAN IP address, send traffic direct.
	//if (!isInNet(myIpAddress(), "194.95.48.*","255.255.255.0"))
		//return "PROXY proxy.th-wildau.de:8080; DIRECT"
	//if (!isInNet(myIpAddress(), "10.100.12.*","255.255.255.0"))
		//return "PROXY proxy.th-wildau.de:8080; DIRECT";


	if (url.substring(0,4) == "http") { return "PROXY proxy.th-wildau.de:8080"; }
 	if (url.substring(0,4) == "HTTP") { return "PROXY proxy.th-wildau.de:8080"; }

// All other traffic uses below proxies, in fail-over order.
	return "DIRECT";
}

====
ftp://ftp.th-wildau.de/wpad.dat

function FindProxyForURL(url, host) {
	// If URL has no dots in host name, send traffic direct.
	//if (isPlainHostName(host))
	//	return "DIRECT";

// If specific URL needs to bypass proxy, send traffic direct.
	if (shExpMatch(url,"*th-wildau.de*") ||
	    shExpMatch(url,"*tfh-wildau.de*"))
		return "DIRECT";

// If IP address is internal or hostname resolves to internal IP, send direct.

	var resolved_ip = dnsResolve(host);

	if (isInNet(resolved_ip, "10.100.12.*", "255.0.0.0") ||
		//isInNet(resolved_ip, "172.16.0.0",  "255.240.0.0") ||
		//isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") ||
		isInNet(resolved_ip, "127.0.0.0", "255.255.255.0"))
		return "DIRECT";

	//if (isInNet(resolved_ip, "194.95.48.*", "255.255.255.0") ||
		//isInNet(resolved_ip, "172.16.0.0",  "255.240.0.0") ||
		//isInNet(resolved_ip, "192.168.0.0", "255.255.0.0") ||
		//isInNet(resolved_ip, "127.0.0.0", "255.255.255.0"))
		//return "PROXY proxy.th-wildau.de:8080; DIRECT";

// If not on a internal/LAN IP address, send traffic direct.
	if (!isInNet(myIpAddress(), "194.95.48.*","255.255.255.0"))
		return "PROXY proxy.th-wildau.de:8080; DIRECT"
	if (!isInNet(myIpAddress(), "10.100.12.*","255.255.255.0"))
		return "PROXY proxy.th-wildau.de:8080; DIRECT";

// All other traffic uses below proxies, in fail-over order.
	return "PROXY proxy.th-wildau.de:8080; DIRECT";
}

Über die Proxy-Auto-Configuration habe ich bereist geschrieben. Wer sich weiter mit dem Thema beschäftigen möchte, findet in den folgenden Links zusätzliche Informationen.