tweak: just use the backup proxy

This commit is contained in:
NunoSempere 2022-02-04 16:49:20 -05:00
parent 76325bcc48
commit d760532e95

View File

@ -20,7 +20,8 @@ String.prototype.replaceAll = function replaceAll(search, replace) {
export async function goodjudgment() { export async function goodjudgment() {
// Proxy fuckery // Proxy fuckery
let proxy; let proxy;
try { /*
* try {
proxy = await axios proxy = await axios
.get("http://pubproxy.com/api/proxy") .get("http://pubproxy.com/api/proxy")
.then((query) => query.data); .then((query) => query.data);
@ -28,11 +29,12 @@ export async function goodjudgment() {
} catch (error) { } catch (error) {
console.log("Proxy generation failed; using backup proxy instead"); console.log("Proxy generation failed; using backup proxy instead");
// hard-coded backup proxy // hard-coded backup proxy
*/
proxy = { proxy = {
ip: process.env.BACKUP_PROXY_IP, ip: process.env.BACKUP_PROXY_IP,
port: process.env.BACKUP_PROXY_PORT, port: process.env.BACKUP_PROXY_PORT,
}; };
} // }
let agent = tunnel.httpsOverHttp({ let agent = tunnel.httpsOverHttp({
proxy: { proxy: {
host: proxy.ip, host: proxy.ip,