Skip to content

Instantly share code, notes, and snippets.

@mfelsche
mfelsche / proxy.pac
Last active August 26, 2016 08:02 — forked from amiorin/proxy.pac
function regExpMatch(url, pattern) {
try { return new RegExp(pattern).test(url); } catch(ex) { return false; }
}
function FindProxyForURL(url, host) {
// Important: replace 172.31 below with the proper prefix for your VPC subnet
if (shExpMatch(url, "*172.31.*")) return "SOCKS5 localhost:8157";
if (shExpMatch(url, "*internal-jenkins-nuggad-*.eu-central-1.elb.amazonaws.com*")) return "SOCKS5 localhost:8157";
if (shExpMatch(url, "*ec2*.amazonaws.com*")) return 'SOCKS5 localhost:8157';
if (shExpMatch(url, "*.compute.internal*") || shExpMatch(url, "*://compute.internal*")) return 'SOCKS5 localhost:8157';