Or you could answer all requests to the VIP with the wpad.dat file content:
You are genius!
The global rule seems best, as I don't need to serve anything more on that VIP, but wpad.dat, so even aliases are not needed, so I inserted the iRule, activated it to VIP, without pools:
when HTTP_REQUEST {
Send the wpad.dat content
HTTP::respond 200 content {\
function FindProxyForURL(url, host) {\
if(shExpMatch(host, "*[^0123456789.]*") == false) \
if( isInNet(host, "127.0.0.0", "255.0.0.0") \
|| isInNet(host, "172.17.0.0", "255.255.0.0") \
|| isInNet(host, "172.18.0.0", "255.255.0.0") \
) \
return "DIRECT"; \
else \
return "PROXY proxy.polsise:8080; DIRECT"; \
else \
if( isPlainHostName(host) \
|| shExpMatch(host, "*.internal") \
|| shExpMatch(host, "*.testing") \
) \
return "DIRECT"; \
else \
return "PROXY proxygateway.internal:8080; DIRECT";}
}
}
I can retrieve the code from wpad VIP, however, it doesn't work for browser, looking the result with browser I did found the newline mark in code - isPlainHostName(host) \ so is something in code missing?