Skip to content

Instantly share code, notes, and snippets.

@weargoggles
Last active July 28, 2021 08:45
Show Gist options
  • Save weargoggles/7aa9e683b9433fd1179432d6fd628397 to your computer and use it in GitHub Desktop.
Save weargoggles/7aa9e683b9433fd1179432d6fd628397 to your computer and use it in GitHub Desktop.
"use strict";
var LAB = /(?:^|\.)lab\.cloud\.ecg\.so$/;
var CLOUD = [
/(?:^|\.)ix3-control\.cloud\.ecg\.so$/,
/(?:^|\.)dus2-control\.cloud\.ecg\.so$/,
/^172\.16\./,
/^172\.18\./,
/(?:^|\.)ams1\.cloud\.ecg\.so$/,
/(?:^|\.)dus1\.cloud\.ecg\.so$/,
/repositories\.cloud\.ecg\.so$/,
/underlay\.cloud$/,
/init1\.cloud$/,
]
function FindProxyForURL(url, host) {
if (host === "[::1]" || host === "localhost" || host === "127.0.0.1") return "DIRECT";
for (var i = 0; i < CLOUD.length; i++) {
if (CLOUD[i].test(host)) {
return "HTTPS ops-proxy.ix3-control.cloud.ecg.so:443";
}
}
// fallback to DIRECT
return "DIRECT";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment