feat: add proxy

This commit is contained in:
NunoSempere 2022-02-04 15:56:47 -05:00
parent 108da329d5
commit e0bc00d6e9

View File

@ -20,12 +20,20 @@ String.prototype.replaceAll = function replaceAll(search, replace) {
/* Body */ /* Body */
export async function goodjudgment() { export async function goodjudgment() {
let results = []; let results = [];
let proxy = await axios
.get("http://pubproxy.com/api/proxy?cookies=true")
.then((query) => query.data);
console.log(proxy);
for (let endpoint of endpoints) { for (let endpoint of endpoints) {
let content = await axios let content = await axios
.get(endpoint, { .get(endpoint, {
headers: { headers: {
"User-Agent": "Axios", "User-Agent": "Axios",
}, },
proxy: {
host: proxy.ip,
port: proxy.port,
},
}) })
.then((query) => query.data); .then((query) => query.data);
let jsonTable = Tabletojson.convert(content, { stripHtmlFromCells: false }); let jsonTable = Tabletojson.convert(content, { stripHtmlFromCells: false });