Skip to content

Instantly share code, notes, and snippets.

@vaer-k
Last active April 2, 2020 09:25
Show Gist options
  • Save vaer-k/793f6b5ce4b5f4dbd8f4d84c40eeb6dd to your computer and use it in GitHub Desktop.
Save vaer-k/793f6b5ce4b5f4dbd8f4d84c40eeb6dd to your computer and use it in GitHub Desktop.
SwitchyOmega AWS EMR proxy configuration
function regExpMatch(url, pattern) {
try { return new RegExp(pattern).test(url); } catch(ex) { return false; }
}
function FindProxyForURL(url, host) {
if (shExpMatch(url, "*ec2*.amazonaws.com*")) return 'SOCKS5 localhost:8157';
if (shExpMatch(url, "*.compute.internal*") || shExpMatch(url, "*://compute.internal*")) return 'SOCKS5 localhost:8157';
if (shExpMatch(url, "*ec2.internal*")) return 'SOCKS5 localhost:8157';
return 'DIRECT';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment